Advertisement
Guest User

Untitled

a guest
Jan 4th, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # switch to safe working directory on ramdisk
  4. cd /
  5.  
  6. if [[ ! -d /mnt/HD_a2 ]]; then
  7. FFP_HDD=/mnt/HD/HD_a2
  8. else
  9. FFP_HDD=/mnt/HD_a2
  10. fi
  11.  
  12. # write a log, in case sth goes wrong
  13. FFP_LOG=$FFP_HDD/ffp.log
  14. #FFP_LOG=/dev/null
  15. exec >>$FFP_LOG 2>&1
  16.  
  17. # real path to ffp
  18. FFP_PATH=$FFP_HDD/ffp
  19.  
  20. # where to search for the install tarball
  21. FFP_TARBALL=$FFP_HDD/fun_plug.tgz
  22.  
  23. # setup script (used for ffp on USB disk)
  24. FFP_SETUP_SCRIPT=$FFP_HDD/.bootstrap/setup.sh
  25.  
  26. # rc file path
  27. FFP_RC=/ffp/etc/rc
  28.  
  29. echo "**** fun_plug script for DNS-323 (2008-08-11 tp@fonz.de) ****"
  30. echo "**** fun_plug script modded by Uli (2012-02-21 ffp@wolf-u.li) ****"
  31. date
  32.  
  33. # check for setup script. an example use for this is to load USB
  34. # kernel modules and mount a USB storage device. The script is
  35. # sourced, that means you can change variables, e.g. FFP_PATH to point
  36. # to the USB device.
  37. if [ -f $FFP_SETUP_SCRIPT ]; then
  38. echo "* Running $SETUP ..."
  39. chmod a+x $FFP_SETUP_SCRIPT
  40. . $FFP_SETUP_SCRIPT
  41. fi
  42.  
  43. # create /ffp link
  44. echo "ln -snf $FFP_PATH /ffp"
  45. ln -snf $FFP_PATH /ffp
  46.  
  47. # install tarball
  48. if [ -r $FFP_TARBALL ]; then
  49. echo "* Installing $FFP_TARBALL ..."
  50. mkdir -p $FFP_PATH && tar xzf $FFP_TARBALL -C $FFP_PATH && /ffp/bin/tar xzf $FFP_TARBALL -C $FFP_PATH
  51. if [ $? -eq 0 ]; then
  52. echo "* OK"
  53. fi
  54. rm $FFP_TARBALL
  55. fi
  56.  
  57. # suid busybox
  58. if [ -x /ffp/bin/busybox ]; then
  59. chown root.root /ffp/bin/busybox
  60. chmod 0755 /ffp/bin/busybox
  61. chmod u+s /ffp/bin/busybox
  62. fi
  63.  
  64. # run fun_plug.init, if present
  65. if [ -x /ffp/etc/fun_plug.init ]; then
  66. echo "* Running /ffp/etc/fun_plug.init ..."
  67. /ffp/etc/fun_plug.init
  68. fi
  69.  
  70. # run fun_plug.local, if present
  71. if [ -x /ffp/etc/fun_plug.local ]; then
  72. echo "* Running /ffp/etc/fun_plug.local ..."
  73. /ffp/etc/fun_plug.local
  74. fi
  75.  
  76. # run commands
  77. if [ -x $FFP_RC ]; then
  78. echo "* Running $FFP_RC ..."
  79. $FFP_RC
  80. echo "* OK"
  81. else
  82. echo "$FFP_RC: Not found or not executable"
  83. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement