Deploy: Fix SSH ControlPath with spaces in home directory
This commit is contained in:
parent
6c3f38a411
commit
30816f2d2d
@ -12,16 +12,16 @@ GIT_REPO="https://git.4nkweb.com/4nk/story-research-zapwall.git"
|
|||||||
# Créer le répertoire de contrôle si nécessaire
|
# Créer le répertoire de contrôle si nécessaire
|
||||||
mkdir -p "$HOME/.ssh/control"
|
mkdir -p "$HOME/.ssh/control"
|
||||||
SSH_CONTROL_PATH="$HOME/.ssh/control/debian_92.243.27.35_22"
|
SSH_CONTROL_PATH="$HOME/.ssh/control/debian_92.243.27.35_22"
|
||||||
SSH_OPTS="-o ControlMaster=auto -o ControlPath=${SSH_CONTROL_PATH} -o ControlPersist=300"
|
SSH_OPTS="-o ControlMaster=auto -o ControlPath=\"${SSH_CONTROL_PATH}\" -o ControlPersist=300"
|
||||||
|
|
||||||
# Fonction pour exécuter une commande SSH avec connexion persistante
|
# Fonction pour exécuter une commande SSH avec connexion persistante
|
||||||
ssh_exec() {
|
ssh_exec() {
|
||||||
ssh ${SSH_OPTS} ${SERVER} "$@"
|
ssh -o ControlMaster=auto -o ControlPath="${SSH_CONTROL_PATH}" -o ControlPersist=300 ${SERVER} "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Nettoyer les connexions SSH persistantes à la fin
|
# Nettoyer les connexions SSH persistantes à la fin
|
||||||
cleanup_ssh() {
|
cleanup_ssh() {
|
||||||
ssh -O exit -o ControlPath=${SSH_CONTROL_PATH} ${SERVER} 2>/dev/null || true
|
ssh -O exit -o ControlPath="${SSH_CONTROL_PATH}" ${SERVER} 2>/dev/null || true
|
||||||
}
|
}
|
||||||
trap cleanup_ssh EXIT
|
trap cleanup_ssh EXIT
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user