Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/ash
- ############
- # Installiere FritzLoad Button auf Login-Seite?
- installLoginButton=0
- ############
- pdir="${1:-$(pwd)}"
- pdir="${pdir%/bin}"
- # recreate parcache after gui initialisation
- . $pdir/bin/recreate_parcache.sh
- htmlmountpath=/usr/mww-fl
- echo "htmlpath=/html" > /var/tmp/fritzload.htmlpath
- helpmsg(){
- echo "Install-GUI wird vom Installer ausgeführt!"
- echo "Direktes Ausführen von der Shell ist nur bedingt sinnvoll."
- echo "Falls Sie das Programm dennoch gesondert starten möchten,"
- echo "so rufen Sie es folgendermaßen auf:"
- echo "$0 $pdir [install|-u]"
- echo " (install = Installation / -u = Deinstallation)"
- }
- installGui(){
- # Wenn Datei nasstatus.txt nicht existiert, anlegen
- [ ! -f /var/tmp/nasstatus.txt ] && echo "off"> /var/tmp/nasstatus.txt
- # dl_ Dateien erstellen, falls beim allerersten Aufruf von FL nicht vorhanden
- for M in 1 2 3 4; do
- [ ! -f $pdir/config/dl_finished$M.txt ] && echo > $pdir/config/dl_finished$M.txt
- [ ! -f $pdir/config/dl_jobs$M.txt ] && echo > $pdir/config/dl_jobs$M.txt
- [ ! -f $pdir/config/dl_failed$M.txt ] && echo > $pdir/config/dl_failed$M.txt
- done
- if [ -d $htmlmountpath ]; then
- mount -o bind $pdir/cgi $htmlmountpath/cgi-bin
- mount -o bind $pdir/html $htmlmountpath/html
- fi
- mkdir -p /var/tmp/fritzloadSTR/www
- [ ! -e $htmlmountpath/cgi-bin/fritzloadstream ] && ln -sf /var/tmp/fritzloadSTR/www $htmlmountpath/cgi-bin/fritzloadstream
- }
- uninstallGui(){
- if [ -e $htmlmountpath/html ]; then
- umount -lf $htmlmountpath/html
- fi
- if [ -e $htmlmountpath/cgi-bin ]; then
- [ -e $htmlmountpath/cgi-bin/fritzloadstream ] && rm -f $htmlmountpath/cgi-bin/fritzloadstream
- umount -lf $htmlmountpath/cgi-bin
- fi
- if [ -e /var/tmp/fritzloadSTR ]; then
- rm -rf /var/tmp/fritzloadSTR
- fi
- }
- case "$2" in
- install)
- installGui
- ;;
- -u)
- uninstallGui
- ;;
- -?|--help)
- helpmsg
- exit 0
- ;;
- *)
- helpmsg >&2
- exit 1
- ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment