initial import

This commit is contained in:
2025-06-22 20:39:04 -05:00
commit f8a70886f0
3428 changed files with 302546 additions and 0 deletions

34
vnstat/vnstat.install Normal file
View File

@@ -0,0 +1,34 @@
post_install(){
if ! getent group vnstat &>/dev/null; then
groupadd -r vnstat >/dev/null
fi
if ! getent passwd vnstat &>/dev/null; then
useradd -r -g vnstat -G adm -d /var/lib/vnstat -s /bin/nologin vnstat >/dev/null
fi
if ! groups vnstat | grep adm &>/dev/null; then
gpasswd -a vnstat adm >/dev/null
fi
vnstat_shell=$(getent passwd vnstat | cut -d: -f7)
if [ "$vnstat_shell" != '/bin/nologin' ]; then
chsh -s /bin/nologin vnstat &>/dev/null
fi
if [[ ! -d /var/lib/vnstat ]]; then
mkdir -p /var/lib/vnstat
fi
chmod 700 /var/lib/vnstat
chown vnstat:vnstat /var/lib/vnstat
}
post_upgrade(){
post_install
}
post_remove(){
echo "-- You may want to remove /var/lib/vnstat"
if getent passwd vnstat &>/dev/null; then
userdel vnstat >/dev/null
fi
if getent group vnstat &>/dev/null; then
groupdel vnstat >/dev/null
fi
}