diff --git a/piratebox/piratebox/bin/shoutbox_stuff.sh b/piratebox/piratebox/bin/shoutbox_stuff.sh index 6f6423a..8eccdde 100755 --- a/piratebox/piratebox/bin/shoutbox_stuff.sh +++ b/piratebox/piratebox/bin/shoutbox_stuff.sh @@ -3,28 +3,28 @@ # Matthias Strubel - (c)2012-2014 with GPL-3 # # Only calls generate-Routing in piratebox-folder -# gets Piratebox-Folder into www +# gets Piratebox-Folder into www # $1 www folder # $2 pirtatebox config file - - -. $2 -cd $PIRATEBOX_FOLDER +. /opt/piratebox/conf/piratebox.conf + + +cd "$PIRATEBOX_FOLDER" cd python_lib -export SHOUTBOX_CHATFILE=$CHATFILE -export SHOUTBOX_GEN_HTMLFILE=$GEN_CHATFILE -export SHOUTBOX_CLIENT_TIMESTAMP=$SHOUTBOX_CLIENT_TIMESTAMP +export SHOUTBOX_CHATFILE="$CHATFILE" +export SHOUTBOX_GEN_HTMLFILE="$GEN_CHATFILE" +export SHOUTBOX_CLIENT_TIMESTAMP="$SHOUTBOX_CLIENT_TIMESTAMP" export DISK_GEN_HTMLFILE=$GEN_DISKFILE #Writing init-message and reset chat.. if [ "$RESET_CHAT" = "yes" ] ; then - cat $PIRATEBOX_FOLDER/conf/chat_init.txt > $CHATFILE + cat "$PIRATEBOX_FOLDER/conf/chat_init.txt" > "$CHATFILE" fi #Generate content file for Shoutbox @@ -33,21 +33,22 @@ python psogen.py generate if [ "$SHOUTBOX_ENABLED" = "no" ] ; then # If the shoutbox is disabled, we remove the writable flag echo -n "Making shoutbox readonly..." - chmod a-w $CHATFILE + chmod a-w "$CHATFILE" echo "done" fi #Generate content file for DiskUsage +rm "$DISK_GEN_HTMLFILE" python diskusage.py generate -$( sleep 20 && touch $GEN_CHATFILE ) & +$( sleep 20 && touch "$GEN_CHATFILE" ) & #Set correct permissions -chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $SHOUTBOX_CHATFILE -chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $SHOUTBOX_GEN_HTMLFILE -chmod ug+rw $SHOUTBOX_CHATFILE -chmod ug+rw $SHOUTBOX_GEN_HTMLFILE +chown "$LIGHTTPD_USER":"$LIGHTTPD_GROUP" "$SHOUTBOX_CHATFILE" +chown "$LIGHTTPD_USER":"$LIGHTTPD_GROUP" "$SHOUTBOX_GEN_HTMLFILE" +chmod ug+rw "$SHOUTBOX_CHATFILE" +chmod ug+rw "$SHOUTBOX_GEN_HTMLFILE" #DiskUsage correct permissions -chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $DISK_GEN_HTMLFILE -chmod ug+rw $DISK_GEN_HTMLFILE +chown "$LIGHTTPD_USER":"$LIGHTTPD_GROUP" "$DISK_GEN_HTMLFILE" +chmod ug+rw "$DISK_GEN_HTMLFILE" diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 2d0829b..e0b9f5c 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -183,7 +183,7 @@ case "$1" in fi #Do shoutbox stuff - $PIRATEBOX/bin/shoutbox_stuff.sh $WWW_FOLDER $CONF + $PIRATEBOX/bin/shoutbox_stuff.sh #Start here the lighttpd i.e. diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 7dbf9b7..54a8d80 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -177,7 +177,7 @@ case "$1" in fi #Do shoutbox stuff - $PIRATEBOX/bin/shoutbox_stuff.sh $WWW_FOLDER $CONF + $PIRATEBOX/bin/shoutbox_stuff.sh #Start here the lighttpd i.e.