36 lines
861 B
Plaintext
36 lines
861 B
Plaintext
#
|
|
# This script creates the avahi and netdev system user/group.
|
|
#
|
|
|
|
case "${ACTION}" in
|
|
pre)
|
|
;;
|
|
post)
|
|
if ! getent group netdev >/dev/null; then
|
|
groupadd -r netdev 2>&1 >/dev/null
|
|
[ $? -ne 0 ] && exit $?
|
|
echo "Created netdev system group."
|
|
fi
|
|
if ! getent passwd netdev >/dev/null; then
|
|
useradd -c "Network device user" \
|
|
-d / -s /sbin/nologin -g netdev -r netdev && \
|
|
passwd -l netdev 2>&1 >/dev/null
|
|
[ $? -ne 0 ] && exit $?
|
|
echo "Created netdev system user."
|
|
fi
|
|
if ! getent group avahi >/dev/null; then
|
|
groupadd -r avahi 2>&1 >/dev/null
|
|
[ $? -ne 0 ] && exit $?
|
|
echo "Created avahi system group."
|
|
fi
|
|
if ! getent passwd avahi >/dev/null; then
|
|
useradd -c "Avahi daemon" \
|
|
-d / -s /sbin/nologin -g avahi -r avahi && \
|
|
passwd -l avahi 2>&1 >/dev/null
|
|
[ $? -ne 0 ] && exit $?
|
|
echo "Created avahi system user."
|
|
fi
|
|
|
|
;;
|
|
esac
|