From 3581d8ec805960aa12e79477b8f2ee07ff704485 Mon Sep 17 00:00:00 2001 From: nativemad Date: Tue, 23 Oct 2018 18:08:14 +0200 Subject: [PATCH] startup cleanup even after reordering --- nlvmi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nlvmi b/nlvmi index 7417c9b..b0c4ff7 100755 --- a/nlvmi +++ b/nlvmi @@ -150,7 +150,7 @@ function vmstart { #prepare tmpfile TMPF=/home/nlvmi/start${array[32]}-${array[1]}.tmp rm /home/nlvmi/start*-${array[1]}.tmp &>/dev/null - touch $TMPF && chmod 660 $TMPF + touch $TMPF && chmod 660 $TMPF && chown nlvmi: $TMPF #add user if necessary echo "if ! \`id -u ${array[2]} &>/dev/null\`; then useradd ${array[2]} -d /run/nlvmi -g nlvmi -M -s /bin/false -G kvm; fi" >>$TMPF #chown mon and pid files @@ -188,10 +188,10 @@ function vmstart { if [ ! -z "${array[35]}" ]; then echo "chmod g+w $RUNDIRECTORY/${array[1]}.mon" >>$TMPF echo "chmod g+r $RUNDIRECTORY/${array[1]}.pid" >>$TMPF - openssl dgst -sha512 -sign "/etc/nlvmi/nlvmi_priv.key" -out /home/nlvmi/${array[1]}.tmp.sha512 $TMPF - TMPFR="/home/nlvmi/rstart{array[32]}-${array[1]}.tmp" + openssl dgst -sha512 -sign "/etc/nlvmi/nlvmi_priv.key" -out /home/nlvmi/start${array[32]}-${array[1]}.tmp.sha512 $TMPF + TMPFR="/home/nlvmi/rstart${array[32]}-${array[1]}.tmp" mv $TMPF $TMPFR - su nlvmi -c "ssh ${array[35]} \"rm /home/nlvmi/start*-${array[1]}.tmp\"" + su nlvmi -c "ssh ${array[35]} \"rm /home/nlvmi/start*-${array[1]}.tmp*\"" mv $TMPFR $TMPF su nlvmi -c "scp $TMPF* ${array[35]}:/home/nlvmi/" su nlvmi -c "ssh ${array[35]} \"/usr/bin/nlvmi remote $TMPF run\""