Guest User

Untitled

a guest
Jul 15th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. . /etc/rc.conf
  4. . /etc/rc.d/functions
  5.  
  6. dirs=(/dev /dev/pts /dev/shm /tmp /home)
  7. case $1 in
  8. start)
  9. stat_busy "Starting Arch32 chroot"
  10. for d in "${dirs[@]}"; do
  11. mount -o bind $d /opt/arch32/$d
  12. done
  13. mount -t proc none /opt/arch32/proc
  14. mount -t sysfs none /opt/arch32/sys
  15. add_daemon arch32
  16. stat_done
  17. ;;
  18. stop)
  19. stat_busy "Stopping Arch32 chroot"
  20. for (( i = ${#dirs[@]} - 1; i >= 0; i-- )); do
  21. umount "/opt/arch32${dirs[i]}"
  22. done
  23. umount /opt/arch32/{proc,sys}
  24. rm_daemon arch32
  25. stat_done
  26. ;;
  27. restart)
  28. $0 stop
  29. sleep 1
  30. $0 start
  31. ;;
  32. *)
  33. echo "usage: $0 {start|stop|restart}"
  34. esac
  35. exit 0
Add Comment
Please, Sign In to add comment