Imported Debian patch 2.4.3-1
This commit is contained in:
parent
26fb71b504
commit
31a319d731
47 changed files with 3098 additions and 0 deletions
55
debian/nut-cgi.postinst
vendored
Normal file
55
debian/nut-cgi.postinst
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
case "$1" in
|
||||
|
||||
configure)
|
||||
|
||||
# make sure the nut user exists and has correct memberships
|
||||
if ! getent group nut >/dev/null; then
|
||||
addgroup --quiet --system nut
|
||||
fi
|
||||
if ! getent passwd nut >/dev/null; then
|
||||
adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut
|
||||
elif ! groups nut | grep -qw nut; then
|
||||
adduser nut nut
|
||||
fi
|
||||
# for Ubuntu, while waiting for a proper debconf
|
||||
# if ! groups nut | grep -qw dialout; then
|
||||
# adduser nut dialout
|
||||
# fi
|
||||
|
||||
# Ensure /etc/nut is readable/crossable for others
|
||||
if [ -d /etc/nut/ ] ; then
|
||||
chmod 755 /etc/nut
|
||||
fi
|
||||
|
||||
# Ensure nut-cgi configuration files are readable by others
|
||||
for file in upsset.conf hosts.conf upsstats.html upsstats-single.html ; do
|
||||
if [ -f /etc/nut/$file ] ; then
|
||||
chmod 644 /etc/nut/$file
|
||||
fi
|
||||
done
|
||||
;;
|
||||
|
||||
abort-upgrade)
|
||||
# do nothing
|
||||
;;
|
||||
|
||||
abort-remove)
|
||||
# do nothing
|
||||
;;
|
||||
|
||||
abort-deconfigure)
|
||||
# do nothing
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "$0: incorrect arguments: $*" >&2
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue