mirror of
https://github.com/YunoHost-Apps/restic_ynh.git
synced 2024-09-03 20:16:22 +02:00
fix: ssh upgrade
This commit is contained in:
parent
e94d93b062
commit
6a3580234d
1 changed files with 12 additions and 9 deletions
|
@ -116,20 +116,23 @@ ynh_script_progression --message="End of upgrade process" --last
|
||||||
# making removal in multi-instance cases break the remaining
|
# making removal in multi-instance cases break the remaining
|
||||||
# instances.
|
# instances.
|
||||||
# So we need to add the delimiters if they are missing
|
# So we need to add the delimiters if they are missing
|
||||||
|
set +o errexit
|
||||||
|
set +o nounset
|
||||||
|
private_key="/root/.ssh/id_${app}_ed25519"
|
||||||
grep -q "begin ${app}" /root/.ssh/config
|
grep -q "begin ${app}" /root/.ssh/config
|
||||||
missing_delimiters="$?"
|
missing_delimiters="$?"
|
||||||
if [ "$missing_delimiters" -eq 1 ];then
|
if [ "$missing_delimiters" -eq 1 ];then
|
||||||
# did not find delimiters so removing old configuration
|
# did not find delimiters so removing old configuration
|
||||||
sed -e "/Host ${server}/,+6d" /root/.ssh/config -i || true
|
sed -e "/Host ${server}/,+6d" /root/.ssh/config -i || true
|
||||||
cat << EOCONF >> ~/.ssh/config
|
cat << EOCONF >> ~/.ssh/config
|
||||||
# begin $app ssh config
|
# begin $app ssh config
|
||||||
Host ${server}
|
Host ${server}
|
||||||
Hostname ${server}
|
Hostname ${server}
|
||||||
Port ${port}
|
Port ${port}
|
||||||
User ${ssh_user}
|
User ${ssh_user}
|
||||||
IdentityFile ${private_key}
|
IdentityFile ${private_key}
|
||||||
StrictHostKeyChecking no
|
StrictHostKeyChecking no
|
||||||
UserKnownHostsFile /dev/null
|
UserKnownHostsFile /dev/null
|
||||||
# end $app ssh config
|
# end $app ssh config
|
||||||
EOCONF
|
EOCONF
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue