mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
30 lines
647 B
Text
30 lines
647 B
Text
set -e
|
|
|
|
force=$1
|
|
|
|
function safe_copy () {
|
|
if [ $force ]; then
|
|
sudo yunohost service safecopy \
|
|
-s ssh \
|
|
$1 $2 \
|
|
--force
|
|
else
|
|
sudo yunohost service safecopy \
|
|
-s ssh \
|
|
$1 $2
|
|
fi
|
|
}
|
|
|
|
cd /usr/share/yunohost/templates/ssh
|
|
|
|
# Only overwrite SSH configuration on an ISO installation
|
|
if [ ! -f /etc/yunohost/from_script ]; then
|
|
|
|
# Do not listen to IPv6 if unavailable
|
|
if [ ! -f /proc/net/if_inet6 ]; then
|
|
sudo sed -i "s/ListenAddress ::/#ListenAddress ::/g" sshd_config
|
|
fi
|
|
safe_copy sshd_config /etc/ssh/sshd_config
|
|
|
|
sudo service ssh restart
|
|
fi
|