|
#!/bin/bash
test -x /usr/bin/VBoxManage || exit 0
for i in `ls /virtualbox/Machines/`
docase "$1" in
start) echo -n "Starting Virtualbox-Image $i"
VBoxManage startvm $i -type vrdp echo "." ;; stop) echo -n "Stopping Virtualbox-Image $i" VBoxManage controlvm $i poweroff echo "." ;; restart) echo -n "Restarting Virtualbox-Image $i" VBoxManage controlvm $i poweroff VBoxManage startvm $i -type vrdp echo "." ;; *) echo "Usage: /etc/init.d/vboxctl {start|stop|restart}" exit 1 esac done
exit 0 |