diff --git a/piratebox/install.sh b/piratebox/install.sh index 5cc6936..4147439 100755 --- a/piratebox/install.sh +++ b/piratebox/install.sh @@ -18,6 +18,8 @@ #======================================================================= #Import PirateBox conf CURRENT_CONF=piratebox/conf/piratebox.conf +scriptfile="$(readlink -f $0)" +CURRENT_DIR="$(dirname ${scriptfile})" #Must be root if [[ $EUID -ne 0 ]]; then @@ -32,7 +34,7 @@ else exit 0 fi -if [[ -f $CURRENT_CONF ]]; then +if [[ -f "$CURRENT_DIR"/$CURRENT_CONF ]]; then . $CURRENT_CONF 2> /dev/null else echo "PirateBox config is not in its normal directory" @@ -44,7 +46,7 @@ if [[ ! -d /opt ]]; then mkdir -p /opt fi -cp -rv piratebox/piratebox /opt &> /dev/null +cp -rv "$CURRENT_DIR"/piratebox /opt &> /dev/null echo "Finished copying files..." echo "$NET.$IP_SHORT piratebox.lan">>/etc/hosts echo "$NET.$IP_SHORT piratebox">>/etc/hosts diff --git a/piratebox/piratebox/bin/distribute_file_into_directory.sh b/piratebox/piratebox/bin/distribute_file_into_directory.sh index 746b648..c051873 100755 --- a/piratebox/piratebox/bin/distribute_file_into_directory.sh +++ b/piratebox/piratebox/bin/distribute_file_into_directory.sh @@ -18,7 +18,7 @@ filename="${src_file##*/}" $DEBUG && echo "filename: $filename" $DEBUG && echo "Overwrite mode : $overwrite " -if [ ! -e $directory/$filename ] || [ "$overwrite" == "true" ] ; then +if [ ! -e $directory/$filename ] || [ "$overwrite" = true ] ; then echo "Distribute $filename into $directory " $DEBUG && echo " cp $src_file $directory " $TEST_RUN || cp $src_file $directory diff --git a/piratebox/piratebox/bin/distribute_files.sh b/piratebox/piratebox/bin/distribute_files.sh index 20530e5..45d59c4 100755 --- a/piratebox/piratebox/bin/distribute_files.sh +++ b/piratebox/piratebox/bin/distribute_files.sh @@ -28,7 +28,7 @@ destination=$1 overwrite=$2 overwrite=${overwrite:=false} src_file=$3 -src_file=${src_file:=all} +src_file=${src_file:="all"} $DEBUG && echo "parameters: destination $destination @@ -38,7 +38,7 @@ $DEBUG && echo "parameters: call script: $script "; -if [ "$src_file" == "all" ] ; then +if [ "$src_file" = "all" ] ; then work_on_file $destination $PIRATEBOX_FOLDER/src/HEADER.txt work_on_file $destination $PIRATEBOX_FOLDER/src/README.txt else diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index 62fd102..bee7a87 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -76,8 +76,8 @@ if [ $2 = 'part2' ] ; then cp $PIRATEBOX_FOLDER/src/kareha.pl $PIRATEBOX_FOLDER/share/board fi - [[ ! -L $PIRATEBOX_FOLDER/www/board ]] && ln -s $PIRATEBOX_FOLDER/share/board $PIRATEBOX_FOLDER/www/board - [[ ! -L $PIRATEBOX_FOLDER/www/Shared ]] && ln -s $UPLOADFOLDER $PIRATEBOX_FOLDER/www/Shared + [ ! -L $PIRATEBOX_FOLDER/www/board ] && ln -s $PIRATEBOX_FOLDER/share/board $PIRATEBOX_FOLDER/www/board + [ ! -L $PIRATEBOX_FOLDER/www/Shared ] && ln -s $UPLOADFOLDER $PIRATEBOX_FOLDER/www/Shared fi #Install the image-board diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index f35aeae..d44e3e2 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -54,7 +54,7 @@ else fi -if [[ -f $PIRATEBOX/conf/init_done ]] ; then +if [ -f $PIRATEBOX/conf/init_done ] ; then INIT=OK else $PIRATEBOX/bin/hooks/hook_pre_init.sh "$CONF"