push config to rx and wm1, create backup accounts
This commit is contained in:
parent
63cef41a73
commit
4ee4772e70
16
launch.sh
16
launch.sh
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2019-2021 Mischa Peters <mischa @ openbsd.amsterdam>
|
||||
# Copyright (c) 2019-2022 Mischa Peters <mischa @ openbsd.amsterdam>
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -38,6 +38,16 @@ else
|
|||
chmod 600 ${VMS}/${1}.txt
|
||||
fi
|
||||
|
||||
if [[ "${SERVER}" == server* ]]; then
|
||||
HOST="s${SERVER#server}"
|
||||
elif [[ "${SERVER}" == mega* ]]; then
|
||||
HOST="m${SERVER#mega}"
|
||||
fi
|
||||
|
||||
openrsync -va --del /home/mischa/vms/ mischa@wm1.obsda.ms:vms/${HOST}/
|
||||
ssh wm1.obsda.ms "doas ./create-user.pl ${HOST}${1}"
|
||||
openrsync -va --del /home/mischa/vms/ mischa@rx.high5.nl:vms/${HOST}/
|
||||
|
||||
deploy.pl
|
||||
rcctl restart dhcpd
|
||||
vmctl reload
|
||||
|
@ -47,7 +57,7 @@ auto-deploy.exp ${1}
|
|||
if [ $? != 0 ]; then
|
||||
vmctl stop -f ${1}
|
||||
rm -rf /var/vmm/${1}.qcow2
|
||||
pushover.pl -m "$(hostname -s) ${1} failed deploy" -p 1
|
||||
pushover.pl -m "$(SERVER) ${1} failed deploy" -p 1
|
||||
exit 1
|
||||
else
|
||||
vmctl stop -f ${1}
|
||||
|
@ -63,5 +73,5 @@ if [ $? ]; then
|
|||
echo
|
||||
echo "SUCCES! - deployed ${1}"
|
||||
notify.pl deployed ${1}
|
||||
pushover.pl -m "$(hostname -s) ${1} deployed" -t "OpenBSD Amsterdam"
|
||||
pushover.pl -m "$(SERVER) ${1} deployed" -t "OpenBSD Amsterdam"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue