mirror of
https://github.com/PirateBox-Dev/PirateBoxScripts_Webserver.git
synced 2023-12-14 07:22:58 +01:00
Better handling of content folder and more dependeing changes
--> Design-Stuff to USB Stick #107
This commit is contained in:
parent
107b3cdf65
commit
09d04d8ff7
5 changed files with 35 additions and 9 deletions
|
@ -3,6 +3,22 @@
|
||||||
## created by Matthias Strubel (c)2011-2014 GPL-3
|
## created by Matthias Strubel (c)2011-2014 GPL-3
|
||||||
##
|
##
|
||||||
|
|
||||||
|
create_content_folder(){
|
||||||
|
|
||||||
|
echo "Creating 'content' folder on USB stick and move over stuff"
|
||||||
|
mkdir -p $WWW_CONTENT
|
||||||
|
cp -r $PIRATEBOX_FOLDER/www_content/* $WWW_CONTENT
|
||||||
|
|
||||||
|
[ ! -L $PIRATEBOX_FOLDER/www/content ] && \
|
||||||
|
ln -s $WWW_CONTENT $WWW_FOLDER/content
|
||||||
|
[ ! -e $WWW_FOLDER/favicon.ico ] && \
|
||||||
|
ln -s $WWW_CONTENT/favicon.ico $WWW_FOLDER
|
||||||
|
|
||||||
|
chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $WWW_CONTENT -R
|
||||||
|
chmod u+rw $WWW_CONTENT
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
# Load configfile
|
# Load configfile
|
||||||
|
|
||||||
if [ -z $1 ] || [ -z $2 ]; then
|
if [ -z $1 ] || [ -z $2 ]; then
|
||||||
|
@ -49,13 +65,6 @@ if [ $2 = 'part2' ] ; then
|
||||||
mkdir -p $PIRATEBOX_FOLDER/share/tmp
|
mkdir -p $PIRATEBOX_FOLDER/share/tmp
|
||||||
mkdir -p $PIRATEBOX_FOLDER/tmp
|
mkdir -p $PIRATEBOX_FOLDER/tmp
|
||||||
|
|
||||||
#Create a content folder copy to the USB Stick
|
|
||||||
cp -rv $PIRATEBOX_FOLDER/www_content $PIRATEBOX_FOLDER/share
|
|
||||||
[ ! -L $PIRATEBOX_FOLDER/www/content ] && \
|
|
||||||
ln -s $PIRATEBOX_FOLDER/share/www_content $WWW_FOLDER/content
|
|
||||||
[ ! -e $WWW_FOLDER/favicon.ico ] && \
|
|
||||||
ln -s $PIRATEBOX_FOLDER/share/www_content/favicon.ico $WWW_FOLDER
|
|
||||||
|
|
||||||
#Distribute the Directory Listing files
|
#Distribute the Directory Listing files
|
||||||
$PIRATEBOX_FOLDER/bin/distribute_files.sh $SHARE_FOLDER/Shared true
|
$PIRATEBOX_FOLDER/bin/distribute_files.sh $SHARE_FOLDER/Shared true
|
||||||
#Set permissions
|
#Set permissions
|
||||||
|
@ -159,3 +168,6 @@ if [ $2 = "hostname" ] ; then
|
||||||
echo "..done"
|
echo "..done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $2 = "content" ] ; then
|
||||||
|
create_content_folder
|
||||||
|
fi
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
PIRATEBOX_FOLDER="/opt/piratebox"
|
PIRATEBOX_FOLDER="/opt/piratebox"
|
||||||
WWW_FOLDER="/opt/piratebox/www"
|
WWW_FOLDER="/opt/piratebox/www"
|
||||||
|
WWW_CONTENT="/opt/piratebox/share/content"
|
||||||
|
|
||||||
#Do not change untill really needed.
|
#Do not change untill really needed.
|
||||||
PIRATEBOX_PYTHONPATH="$PIRATEBOX_FOLDER/python_lib"
|
PIRATEBOX_PYTHONPATH="$PIRATEBOX_FOLDER/python_lib"
|
||||||
|
|
|
@ -69,7 +69,12 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Recreate the content folder, if it was deleted
|
||||||
|
# only if it is not already existing.
|
||||||
|
# This can be any time.
|
||||||
|
if [ ! -d $WWW_CONTENT ] ; then
|
||||||
|
$PIRATEBOX/bin/install_piratebox.sh "$CONF" content
|
||||||
|
fi
|
||||||
|
|
||||||
# Command Line for DNSMASQ, use extra config file generated from command above
|
# Command Line for DNSMASQ, use extra config file generated from command above
|
||||||
CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ "
|
CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ "
|
||||||
|
|
|
@ -62,6 +62,14 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Recreate the content folder, if it was deleted
|
||||||
|
# only if it is not already existing.
|
||||||
|
# This can be any time.
|
||||||
|
if [ ! -d $WWW_CONTENT ] ; then
|
||||||
|
$PIRATEBOX/bin/install_piratebox.sh "$CONF" content
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Command Line for DNSMASQ, use extra config file generated from command above
|
# Command Line for DNSMASQ, use extra config file generated from command above
|
||||||
CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ "
|
CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ "
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<html>
|
<html>
|
||||||
<head><title>Redirect...</title>
|
<head><title>Redirect...</title>
|
||||||
<meta http-equiv='refresh' content='0;url=http://#####HOST#####/' />
|
<meta http-equiv='refresh' content='0;url=http://#####HOST#####/content' />
|
||||||
<meta http-equiv='cache-control' content='no-cache, no-store, must-revalidate' />
|
<meta http-equiv='cache-control' content='no-cache, no-store, must-revalidate' />
|
||||||
<meta http-equiv='pragma' content='no-cache' />
|
<meta http-equiv='pragma' content='no-cache' />
|
||||||
<meta http-equiv='expires' content='0' />
|
<meta http-equiv='expires' content='0' />
|
||||||
|
|
Loading…
Reference in a new issue