fix cleanup of deploypass

This commit is contained in:
Alex 2023-03-15 17:49:09 +01:00
parent f6c4576b6c
commit 2a0eff07c0
2 changed files with 5 additions and 5 deletions

View file

@ -1 +0,0 @@
../../../secretmgr/convertsecrets

View file

@ -33,13 +33,14 @@ fi
SSH_CONFIG=cluster/$CLUSTER/ssh_config SSH_CONFIG=cluster/$CLUSTER/ssh_config
function header { function header {
RANDNAME=$(openssl rand -hex 12)
cat <<EOF cat <<EOF
cat > /tmp/deploytool_askpass <<EOG cat > /tmp/deploytool_askpass_$RANDNAME <<EOG
#!/usr/bin/env sh #!/usr/bin/env sh
echo "\\\$DEPLOYTOOL_ROOT_PASSWORD" echo "\\\$DEPLOYTOOL_ROOT_PASSWORD"
EOG EOG
chmod +x /tmp/deploytool_askpass chmod +x /tmp/deploytool_askpass_$RANDNAME
export SUDO_ASKPASS=/tmp/deploytool_askpass export SUDO_ASKPASS=/tmp/deploytool_askpass_$RANDNAME
export DEPLOYTOOL_ROOT_PASSWORD="$ROOT_PASS" export DEPLOYTOOL_ROOT_PASSWORD="$ROOT_PASS"
sudo -A sh - <<'EOEVERYTHING' sudo -A sh - <<'EOEVERYTHING'
set -e set -e
@ -47,8 +48,8 @@ EOF
} }
function footer { function footer {
echo rm -v '/tmp/deploytool_askpass*'
echo EOEVERYTHING echo EOEVERYTHING
echo rm /tmp/deploytool_askpass
} }
function message { function message {