Guest User

Untitled

a guest
Mar 4th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. #!/bin/ash
  2.  
  3. ############
  4.  
  5. # Installiere FritzLoad Button auf Login-Seite?
  6. installLoginButton=0
  7.  
  8. ############
  9.  
  10. pdir="${1:-$(pwd)}"
  11. pdir="${pdir%/bin}"
  12.  
  13. # recreate parcache after gui initialisation
  14. . $pdir/bin/recreate_parcache.sh
  15.  
  16. htmlmountpath=/usr/mww-fl
  17. echo "htmlpath=/html" > /var/tmp/fritzload.htmlpath
  18.  
  19. helpmsg(){
  20. echo "Install-GUI wird vom Installer ausgeführt!"
  21. echo "Direktes Ausführen von der Shell ist nur bedingt sinnvoll."
  22. echo "Falls Sie das Programm dennoch gesondert starten möchten,"
  23. echo "so rufen Sie es folgendermaßen auf:"
  24. echo "$0 $pdir [install|-u]"
  25. echo " (install = Installation / -u = Deinstallation)"
  26. }
  27.  
  28. installGui(){
  29.  
  30. # Wenn Datei nasstatus.txt nicht existiert, anlegen
  31. [ ! -f /var/tmp/nasstatus.txt ] && echo "off"> /var/tmp/nasstatus.txt
  32. # dl_ Dateien erstellen, falls beim allerersten Aufruf von FL nicht vorhanden
  33. for M in 1 2 3 4; do
  34. [ ! -f $pdir/config/dl_finished$M.txt ] && echo > $pdir/config/dl_finished$M.txt
  35. [ ! -f $pdir/config/dl_jobs$M.txt ] && echo > $pdir/config/dl_jobs$M.txt
  36. [ ! -f $pdir/config/dl_failed$M.txt ] && echo > $pdir/config/dl_failed$M.txt
  37. done
  38.  
  39. if [ -d $htmlmountpath ]; then
  40. mount -o bind $pdir/cgi $htmlmountpath/cgi-bin
  41. mount -o bind $pdir/html $htmlmountpath/html
  42. fi
  43. mkdir -p /var/tmp/fritzloadSTR/www
  44. [ ! -e $htmlmountpath/cgi-bin/fritzloadstream ] && ln -sf /var/tmp/fritzloadSTR/www $htmlmountpath/cgi-bin/fritzloadstream
  45. }
  46.  
  47. uninstallGui(){
  48. if [ -e $htmlmountpath/html ]; then
  49. umount -lf $htmlmountpath/html
  50. fi
  51. if [ -e $htmlmountpath/cgi-bin ]; then
  52. [ -e $htmlmountpath/cgi-bin/fritzloadstream ] && rm -f $htmlmountpath/cgi-bin/fritzloadstream
  53. umount -lf $htmlmountpath/cgi-bin
  54. fi
  55. if [ -e /var/tmp/fritzloadSTR ]; then
  56. rm -rf /var/tmp/fritzloadSTR
  57. fi
  58. }
  59.  
  60. case "$2" in
  61. install)
  62. installGui
  63. ;;
  64. -u)
  65. uninstallGui
  66. ;;
  67. -?|--help)
  68. helpmsg
  69. exit 0
  70. ;;
  71. *)
  72. helpmsg >&2
  73. exit 1
  74. ;;
  75. esac
Advertisement
Add Comment
Please, Sign In to add comment