From 4ee4772e70c8f456cfe298ea757b849c2ec470a6 Mon Sep 17 00:00:00 2001 From: mischa Date: Tue, 22 Nov 2022 18:01:17 +0100 Subject: [PATCH] push config to rx and wm1, create backup accounts --- launch.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/launch.sh b/launch.sh index c497707..2660283 100755 --- a/launch.sh +++ b/launch.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2019-2021 Mischa Peters +# Copyright (c) 2019-2022 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 @@ -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