ap51-flash.sh 431 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. NAME=ap51-flash
  3. rootfs=""
  4. kernel=""
  5. ubnt=""
  6. [ $1 -eq "1" ] && loop="1"
  7. ifname="$2"
  8. [ -n "$3" ] && rootfs="--rootfs $3"
  9. [ -n "$4" ] && kernel="--kernel $4"
  10. [ -n "$5" ] && ubnt="--ubnt $5"
  11. while [ 1 ]; do
  12. start-stop-daemon -S -m -p /var/run/$NAME-$ifname.pid -n $NAME \
  13. -x /usr/sbin/$NAME -- --flash-from-file $rootfs $kernel $ubnt $ifname
  14. rm /var/run/$NAME-$ifname.pid
  15. [ "$loop" != "1" ] && break
  16. sleep 15
  17. done