2 if [ -z "`grep '^ups::' /etc/group`" ]; then
3 groupadd -g 227 ups >& /dev/null
5 if [ -z "`grep '^nut:' /etc/passwd`" ]; then
6 useradd -u 227 -g ups -d /var/lib/nut -s /bin/false nut
9 chown -R nut:ups /var/lib/nut &> /dev/null
11 chown nut:ups /var/run/nut &> /dev/null
12 echo "----------------------------------"
13 echo "To load Udev Rules without restart"
14 echo "issue the command 'udevadm trigger'"
15 echo "----------------------------------"
19 getent group ups &>/dev/null || groupadd -g 227 ups &>/dev/null
20 getent passwd nut &>/dev/null || useradd -u 227 -g ups -d /var/lib/nut -s /bin/false nut &>/dev/null
21 chown -R nut:ups /var/lib/nut &> /dev/null
22 chown nut:ups /var/run/nut &> /dev/null
23 echo "--------------------------------------"
24 echo "To load new Udev Rules without restart"
25 echo " issue the command 'udevadm trigger'"
26 echo "--------------------------------------"
30 getent passwd nut &>/dev/null || userdel nut &>/dev/null
31 getent group ups &>/dev/null || groupdel ups &>/dev/null