few modules improved

This commit is contained in:
fatalerrors
2021-07-23 12:24:11 +02:00
parent cbacea764f
commit 3696a720da
4 changed files with 32 additions and 8 deletions

View File

@@ -6,7 +6,7 @@
# * MAINDOM: Default main domain name # * MAINDOM: Default main domain name
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
export VER_conf_mail="0.0.2" export VER_conf_mail="0.0.3"
conf_mail() conf_mail()
{ {
@@ -22,7 +22,10 @@ conf_mail()
precheck_conf_mail() precheck_conf_mail()
{ {
: # Nothing to check [[ -n $MAINDOM ]] && (
prnt E "Aucun domaine principal renseigné."
die 158
)
} }
export -f conf_mail export -f conf_mail

View File

@@ -1,3 +1,10 @@
# ------------------------------------------------------------------------------
# Install check_mk agent using xinetd superserver
# ------------------------------------------------------------------------------
# Variable:
# * MK_SERVER: Server IP address
# * MK_PORT: Port check_mk agent will use to communicate with server
# ------------------------------------------------------------------------------
export VER_install_mkagent="0.0.1" export VER_install_mkagent="0.0.1"
@@ -6,12 +13,16 @@ install_mkagent()
pkginst $MYPATH/repo/mk_agents/check-mk-agent_${MKVERSION}_all.deb pkginst $MYPATH/repo/mk_agents/check-mk-agent_${MKVERSION}_all.deb
backupdist /etc/xinetd.d/check_mk backupdist /etc/xinetd.d/check_mk
installfile check_mk /etc/xinetd.d/check_mk installfile check_mk /etc/xinetd.d/check_mk
sed -i -e "s/@MK_SERVER@/$MK_SERVER/" /etc/xinetd.d/check_mk
svc_restart xinetd svc_restart xinetd
} }
precheck_install_mkagent() precheck_install_mkagent()
{ {
: # rien à vérifier [[ -n $MK_SERVER ]] && (
prnt E "Serveur check_mk non déclaré."
die 162
)
} }
export -f install_mkagent export -f install_mkagent

View File

@@ -29,14 +29,14 @@ install_pkg()
done done
fi fi
# Cleaning
prnt I "Suppression des paquets résiduels le cas échéant..."
pkgautorem
# Install all the configured packages # Install all the configured packages
[[ -n $PKGSEL ]] && [[ -n $PKGSEL ]] &&
prnt I "Installation de la sélection de paquets..." && prnt I "Installation de la sélection de paquets..." &&
pkginst $PKGSEL pkginst $PKGSEL
# Cleaning
prnt I "Suppression des paquets résiduels le cas échéant..."
pkgautorem
} }
precheck_install_pkg() precheck_install_pkg()

View File

@@ -5,17 +5,27 @@ export VER_install_profile="0.0.1"
install_profile() install_profile()
{ {
installfile ansi_shadow.flf /usr/share/figlet/ansi_shadow.flf installfile ansi_shadow.flf /usr/share/figlet/ansi_shadow.flf
# Create a dir in home so /home/* is always interpreted correctly
mkdir -pv /home/dummy
for usr in /root /home/*; do for usr in /root /home/*; do
backupdist $usr/{,.}profile $usr/.bashrc backupdist $usr/{,.}profile $usr/.bashrc
installfile {{.,}profile,.bashrc} $usr/ installfile {{.,}profile,.bashrc} $usr/
done done
# Remove dummy dir
rm -rf /home/dummy
backupdist /etc/motd backupdist /etc/motd
installfile motd /etc/motd installfile motd /etc/motd
} }
precheck_install_profile() precheck_install_profile()
{ {
: [[ -d /home/dummy ]] && (
prnt E "/home/dummy existe mais est réservé a un usage interne."
die 155
)
} }
export -f install_profile export -f install_profile