diff --git a/auto-deploy.exp b/auto-deploy.exp index 28f610b..b422308 100755 --- a/auto-deploy.exp +++ b/auto-deploy.exp @@ -1,6 +1,6 @@ #!/usr/local/bin/expect -f # -# Copyright (c) 2019 Mischa Peters +# Copyright (c) 2019-2020 Mischa Peters # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -20,4 +20,14 @@ spawn vmctl start -c $vmid expect "(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? " sleep 3 send "a\r" -expect "(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? " +expect { + -re "Response file location?.*" { + exit 1 + } + "Performing non-interactive install..." { + exp_continue + } + "(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? " { + exit 0 + } +} diff --git a/launch.sh b/launch.sh index a696de5..b56f3ca 100755 --- a/launch.sh +++ b/launch.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2019 Mischa Peters +# Copyright (c) 2019-2020 Mischa Peters # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -36,7 +36,12 @@ vmctl reload sleep 10 auto-deploy.exp ${1} -if [ $? ]; then +if [ $? != 0 ]; then + vmctl stop -f ${1} + rm -rf /var/vmm/${1}.qcow2 + pushover.pl -m "$(hostname -s) ${1} failed deploy" -p 1 + exit 1 +else vmctl stop -f ${1} fi @@ -50,4 +55,5 @@ if [ $? ]; then echo echo "SUCCES! - deployed ${1}" notify.pl deployed ${1} + pushover.pl -m "$(hostname -s) ${1} deployed" fi