You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

39 lines
774 B

#!/bin/sh
VMSW=KVM
if [ -n "$USE_LXC" ]; then
VMSW=LXC
elif [ -n "$USE_VBOX" ]; then
VMSW=VBOX
elif [ -n "$USE_DOCKER" ]; then
VMSW=DOCKER
fi
case $VMSW in
KVM)
if [ ! -e var/target.pid ]; then exit; fi
on-target -u root poweroff
sleep 5
if [ ! -e var/target.pid ]; then exit; fi
sleep 5
if [ ! -e var/target.pid ]; then exit; fi
echo Killing target since it did not shutdown within 10 seconds
kill `cat var/target.pid`
;;
LXC)
true
;;
VBOX)
if [ ! -e var/target.vmname ]; then exit; fi
VBoxManage controlvm `cat var/target.vmname` savestate
rm var/target.vmname
;;
DOCKER)
docker container stop gitian-target > /dev/null
docker container rm gitian-target > /dev/null
;;
esac