mirror of
https://github.com/PirateBox-Dev/PirateBoxScripts_Webserver.git
synced 2026-12-05 00:38:42 +00:00
Merge pull request #92 from Sjd-Risca/installscript
Install script corrections
This commit is contained in:
commit
9e44802ba4
5 files changed
+10
-8
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user