-if [ -n "`/usr/bin/getgid radius`" ]; then
- if [ "`getgid radius`" != "29" ]; then
- echo "Error: group radius doesn't have gid=29. Correct this before installing radius." 1>&2
- exit 1
- fi
-else
- /usr/sbin/groupadd -g 29 -r -f radius
- if [ -n "`id -u radius 2>/dev/null`" ]; then
- # upgrade from previous versions of the package, where radius' gid was "nobody"
- if [ "`id -g radius`" = "99" ]; then
- usermod -g 29 radius
- chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
- chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
- fi
- fi
-fi
-if [ -n "`id -u radius 2>/dev/null`" ]; then
- if [ "`id -u radius`" != "29" ]; then
- echo "Error: user radius doesn't have uid=29. Correct this before installing radius server." 1>&2
- exit 1
- fi
-else
- /usr/sbin/useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius 1>&2
+%groupadd -g 29 -r -f radius
+%useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius
+
+# TODO: should be in trigger instead.
+# upgrade from previous versions of the package, where radius' gid was "nobody"
+if [ "`id -g radius`" = "99" ]; then
+ usermod -g 29 radius
+ chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
+ chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :