File tree Expand file tree Collapse file tree 5 files changed +10
-8
lines changed Expand file tree Collapse file tree 5 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1818# =======================================================================
1919# Import PirateBox conf
2020CURRENT_CONF=piratebox/conf/piratebox.conf
21+ scriptfile=" $( readlink -f $0 ) "
22+ CURRENT_DIR=" $( dirname ${scriptfile} ) "
2123
2224# Must be root
2325if [[ $EUID -ne 0 ]]; then
3234 exit 0
3335fi
3436
35- if [[ -f $CURRENT_CONF ]]; then
37+ if [[ -f " $CURRENT_DIR " / $CURRENT_CONF ]]; then
3638 . $CURRENT_CONF 2> /dev/null
3739else
3840 echo " PirateBox config is not in its normal directory"
@@ -44,7 +46,7 @@ if [[ ! -d /opt ]]; then
4446 mkdir -p /opt
4547fi
4648
47- cp -rv piratebox /piratebox /opt & > /dev/null
49+ cp -rv " $CURRENT_DIR " /piratebox /opt & > /dev/null
4850echo " Finished copying files..."
4951echo " $NET .$IP_SHORT piratebox.lan" >> /etc/hosts
5052echo " $NET .$IP_SHORT piratebox" >> /etc/hosts
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ filename="${src_file##*/}"
1818 $DEBUG && echo " filename: $filename "
1919 $DEBUG && echo " Overwrite mode : $overwrite "
2020
21- if [ ! -e $directory /$filename ] || [ " $overwrite " == " true" ] ; then
21+ if [ ! -e $directory /$filename ] || [ " $overwrite " = true ] ; then
2222 echo " Distribute $filename into $directory "
2323 $DEBUG && echo " cp $src_file $directory "
2424 $TEST_RUN || cp $src_file $directory
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ destination=$1
2828overwrite=$2
2929overwrite=${overwrite:= false}
3030src_file=$3
31- src_file=${src_file:= all}
31+ src_file=${src_file:= " all" }
3232
3333$DEBUG && echo " parameters:
3434 destination $destination
@@ -38,7 +38,7 @@ $DEBUG && echo "parameters:
3838 call script: $script
3939 " ;
4040
41- if [ " $src_file " == " all" ] ; then
41+ if [ " $src_file " = " all" ] ; then
4242 work_on_file $destination $PIRATEBOX_FOLDER /src/HEADER.txt
4343 work_on_file $destination $PIRATEBOX_FOLDER /src/README.txt
4444else
Original file line number Diff line number Diff line change @@ -76,8 +76,8 @@ if [ $2 = 'part2' ] ; then
7676 cp $PIRATEBOX_FOLDER /src/kareha.pl $PIRATEBOX_FOLDER /share/board
7777 fi
7878
79- [[ ! -L $PIRATEBOX_FOLDER /www/board ]] && ln -s $PIRATEBOX_FOLDER /share/board $PIRATEBOX_FOLDER /www/board
80- [[ ! -L $PIRATEBOX_FOLDER /www/Shared ]] && ln -s $UPLOADFOLDER $PIRATEBOX_FOLDER /www/Shared
79+ [ ! -L $PIRATEBOX_FOLDER /www/board ] && ln -s $PIRATEBOX_FOLDER /share/board $PIRATEBOX_FOLDER /www/board
80+ [ ! -L $PIRATEBOX_FOLDER /www/Shared ] && ln -s $UPLOADFOLDER $PIRATEBOX_FOLDER /www/Shared
8181fi
8282
8383# Install the image-board
Original file line number Diff line number Diff line change 5454fi
5555
5656
57- if [[ -f $PIRATEBOX /conf/init_done ] ] ; then
57+ if [ -f $PIRATEBOX /conf/init_done ] ; then
5858 INIT=OK
5959else
6060 $PIRATEBOX /bin/hooks/hook_pre_init.sh " $CONF "
You can’t perform that action at this time.
0 commit comments