Added services management, first shot on ssh module

This commit is contained in:
fatalerrors
2021-06-09 17:49:54 +02:00
parent 71540b49e6
commit e970f24a5c
4 changed files with 86 additions and 2 deletions

View File

@@ -1,9 +1,12 @@
# NTP
export VER_conf_ntp="0.0.1"
export VER_conf_ntp="0.0.2"
conf_ntp()
{
prnt I "Arrêt du service ntp..."
svc_stop ntp
prnt I "Installation du fichier de configuration de NTP."
dest="/etc/ntp.conf.work"
backupdist /etc/ntp.conf
@@ -15,6 +18,9 @@ conf_ntp()
sed -i -e "s/@SERVERLIST@/$line/" $dest &&
echo "# Generated on $(date --rfc-3339=seconds)" >> $dest &&
mv -fv $dest /etc/ntp.conf
prnt I "Démarrage du service ntp..."
svc_start ntp
}
# NTP

35
modules/conf_ssh.sh Normal file
View File

@@ -0,0 +1,35 @@
# Configuration des client et serveur SSH
export VER_conf_ssh="0.0.1"
conf_ssh()
{
prnt I "Installation du serveur OpenSSH..."
pkginst openssh-server
prnt I "Arrêt du service SSH..."
svc_stop ssh
prnt I "Installation des fichiers de configuration de SSH..."
for f in /etc/ssh/ssh{,d}_config; do
dest="$f.work"
backupdist $f
installfile $(basename $f) $dest
# A finir
echo "# Generated on $(date --rfc-3339=seconds)" >> $dest &&
mv -fv $dest $f
done
prnt I "Démarrage du sevice ssh..."
svc_start ssh
}
precheck_conf_ssh()
{
# A finir
}
export -f conf_ssh
export -f precheck_conf_ssh