Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- . /etc/rc.conf
- . /etc/rc.d/functions
- dirs=(/dev /dev/pts /dev/shm /tmp /home)
- case $1 in
- start)
- stat_busy "Starting Arch32 chroot"
- for d in "${dirs[@]}"; do
- mount -o bind $d /opt/arch32/$d
- done
- mount -t proc none /opt/arch32/proc
- mount -t sysfs none /opt/arch32/sys
- add_daemon arch32
- stat_done
- ;;
- stop)
- stat_busy "Stopping Arch32 chroot"
- for (( i = ${#dirs[@]} - 1; i >= 0; i-- )); do
- umount "/opt/arch32${dirs[i]}"
- done
- umount /opt/arch32/{proc,sys}
- rm_daemon arch32
- stat_done
- ;;
- restart)
- $0 stop
- sleep 1
- $0 start
- ;;
- *)
- echo "usage: $0 {start|stop|restart}"
- esac
- exit 0
Add Comment
Please, Sign In to add comment