Better handling of content folder and more dependeing changes

-->  Design-Stuff to USB Stick #107
This commit is contained in:
Matthias Strubel 2016-05-10 20:09:49 +02:00
parent 107b3cdf65
commit 09d04d8ff7
5 changed files with 35 additions and 9 deletions

View File

@ -3,6 +3,22 @@
## 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
if [ -z $1 ] || [ -z $2 ]; then
@ -49,13 +65,6 @@ if [ $2 = 'part2' ] ; then
mkdir -p $PIRATEBOX_FOLDER/share/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
$PIRATEBOX_FOLDER/bin/distribute_files.sh $SHARE_FOLDER/Shared true
#Set permissions
@ -159,3 +168,6 @@ if [ $2 = "hostname" ] ; then
echo "..done"
fi
if [ $2 = "content" ] ; then
create_content_folder
fi

View File

@ -20,6 +20,7 @@
PIRATEBOX_FOLDER="/opt/piratebox"
WWW_FOLDER="/opt/piratebox/www"
WWW_CONTENT="/opt/piratebox/share/content"
#Do not change untill really needed.
PIRATEBOX_PYTHONPATH="$PIRATEBOX_FOLDER/python_lib"

View File

@ -69,7 +69,12 @@ else
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
CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ "

View File

@ -62,6 +62,14 @@ else
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
CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ "

View File

@ -1,6 +1,6 @@
<html>
<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='pragma' content='no-cache' />
<meta http-equiv='expires' content='0' />