reorganized common repo, some minor modules improvements
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
# none
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
export VER_conf_ssh="0.0.1"
|
||||
export VER_conf_ssh="0.1.0"
|
||||
export DEP_conf_ssh="upgrade_dist"
|
||||
|
||||
conf_ssh()
|
||||
@@ -27,6 +27,7 @@ conf_ssh()
|
||||
backupdist $f
|
||||
installfile ssh/$(basename $f) /etc/ssh/$(basename $f)
|
||||
done
|
||||
sed -i -e "s/@SSHD_PERMITROOT_RANGE@/$SSHD_PERMITROOT_RANGE/" /etc/ssh/sshd_config
|
||||
|
||||
prnt I "Démarrage du sevice ssh..."
|
||||
svc_start ssh
|
||||
|
||||
@@ -28,8 +28,8 @@ install_pkg()
|
||||
if [[ -n PKGS_BLACKLIST ]]; then
|
||||
for pkg in $PKGS_BLACKLIST; do
|
||||
prnt I "Mise du paquet $pkg en liste noire..."
|
||||
local dest=/etc/apt/preferences.d/blacklist_$pkg.conf
|
||||
installfile blacklist.conf $dest &&
|
||||
local dest=/etc/apt/preferences.d/blacklist_$pkg
|
||||
installfile pkgman/blacklist.conf $dest &&
|
||||
sed -i -e "s/@pkg@/pkg/" $dest
|
||||
|
||||
# If blacklisted we suppose uninstall as well (if neeeded)
|
||||
@@ -65,6 +65,7 @@ precheck_install_pkg()
|
||||
else
|
||||
prnt I "$(echo $PKGSEL | wc -w) paquets additionels seront installés."
|
||||
fi
|
||||
file_exists pkgman/blacklist.conf
|
||||
}
|
||||
|
||||
export -f install_pkg
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
# https://opensource.org/licenses/BSD-3-Clause
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
export VER_install_profile="0.0.3"
|
||||
export DEP_install_profile="install_pkg auth"
|
||||
export VER_install_profile="0.0.4"
|
||||
export DEP_install_profile="install_pkg"
|
||||
|
||||
install_profile()
|
||||
{
|
||||
|
||||
@@ -17,7 +17,8 @@ patch_snmp()
|
||||
backupdist /etc/snmp/snmpd.conf /etc/default/snmpd \
|
||||
/lib/systemd/system/snmpd.service /etc/init.d/snmpd
|
||||
installfile snmpd/snmpd.conf /etc/snmp/snmpd.conf
|
||||
installfile snmpd/snmpd.init /etc/init.d/snmpd
|
||||
# No longer required with Debian >= 11 or Devuan >= 4
|
||||
# installfile snmpd/snmpd.init /etc/init.d/snmpd
|
||||
installfile snmpd/snmpd.default /etc/default/snmpd
|
||||
if [[ -e /lib/systemd/system/snmpd.service ]]; then
|
||||
installfile snmpd/snmpd.service /lib/systemd/system/snmpd.service
|
||||
|
||||
@@ -31,11 +31,11 @@ upgrade_dist()
|
||||
echo 'APT::AutoRemove::RecommendsImportant "false";' >> $norecommends
|
||||
echo 'APT::AutoRemove::SuggestsImportant "false";' >> $norecommends
|
||||
|
||||
prnt I "Configuration du proxy pour APT..."
|
||||
prnt I "Configuring proxy for APT..."
|
||||
if [[ -n $PROXYAPT ]]; then
|
||||
if [[ ! -d $(dirname $proxyfile) ]]; then
|
||||
mkdir -pv $(dirname $proxyfile) || (
|
||||
prnt E "Impossiblle de créer le répertoire d'accueil pour la configuration d'APT."
|
||||
prnt E "Impossible to create directory to receive APT configuration."
|
||||
die 60
|
||||
)
|
||||
fi
|
||||
@@ -45,32 +45,32 @@ upgrade_dist()
|
||||
echo "# Generated automatically on $(stdtime) by $0" > $proxyfile
|
||||
echo "Acquire::http::Proxy \"http://${http_proxy}\";" >> $proxyfile
|
||||
else
|
||||
prnt I "Pas de proxy configuré, ne fait rien."
|
||||
prnt I "No proxy configured, nothing to do."
|
||||
fi
|
||||
|
||||
# Remplace source.list from dist with ours (be smarter)
|
||||
installfile "pkgman/${SYS_DIST}_${SYS_VER}.list" /etc/apt/sources.list
|
||||
|
||||
prnt I "Mise à jour de la liste des paquets..."
|
||||
prnt I "Updating package list..."
|
||||
pkgupdt
|
||||
|
||||
prnt I "Application des mises à jour de paquets..."
|
||||
prnt I "Applying packages upgrades..."
|
||||
pkgupgd
|
||||
|
||||
prnt I "Suppression des paquets résiduels..."
|
||||
prnt I "Deleting no longer needed packages..."
|
||||
pkgautorm
|
||||
}
|
||||
|
||||
precheck_upgrade_dist()
|
||||
{
|
||||
prnt I "Vérification du réseau..."
|
||||
prnt I "Checking network connectivity..."
|
||||
|
||||
if [[ $(noerror wget -q --tries=10 --timeout=20 --spider http://www.cnrs.fr) != 0 ]]; then
|
||||
prnt E "It seems network configuration is not functionnal! Giving up."
|
||||
die 160
|
||||
fi
|
||||
if [[ -n $PROXYAPT && -z $PROXYAPT_PORT ]]; then
|
||||
prnt E "Un serveur proxy a été spécifié mais pas son port d'usage."
|
||||
prnt E "A proxy server have been specified but not its working port."
|
||||
die 160
|
||||
fi
|
||||
file_exists pkgman/${SYS_DIST}_${SYS_VER}.list
|
||||
|
||||
Reference in New Issue
Block a user