vmtools/autostopvm
cecilkorik 7b51226796 initial import
--HG--
branch : vmtools
2011-03-05 08:34:41 +00:00

14 lines
297 B
Python
Executable file

#!/usr/bin/python
import os, sys, subprocess
os.environ['VBOX_USER_HOME'] = '/srv/vbox'
if not os.path.exists('/var/run/vbox'):
sys.exit(0)
devnull = open('/dev/null', 'wb')
for name in os.listdir('/var/run/vbox'):
subprocess.Popen(['/usr/local/sbin/stopvm', name], env=os.environ).wait()