diff options
Diffstat (limited to 'rcynic/rules.freebsd.mk')
-rw-r--r-- | rcynic/rules.freebsd.mk | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/rcynic/rules.freebsd.mk b/rcynic/rules.freebsd.mk new file mode 100644 index 00000000..3eab4780 --- /dev/null +++ b/rcynic/rules.freebsd.mk @@ -0,0 +1,25 @@ +# $Id$ + +create-rcynic-user-and-group: .FORCE + if /usr/sbin/pw groupshow "${RCYNIC_GROUP}" 2>/dev/null; \ + then \ + echo "You already have a group \"${RCYNIC_GROUP}\", so I will use it."; \ + elif /usr/sbin/pw groupadd ${RCYNIC_GROUP}; \ + then \ + echo "Added group \"${RCYNIC_GROUP}\"."; \ + else \ + echo "Adding group \"${RCYNIC_GROUP}\" failed..."; \ + echo "Please create it, then try again."; \ + exit 1; \ + fi + if /usr/sbin/pw usershow "${RCYNIC_USER}" 2>/dev/null; \ + then \ + echo "You already have a user \"${RCYNIC_USER}\", so I will use it."; \ + elif /usr/sbin/pw useradd ${RCYNIC_USER} -g ${RCYNIC_GROUP} -h - -d /nonexistant -s /usr/sbin/nologin -c "${RCYNIC_GECOS}"; \ + then \ + echo "Added user \"${RCYNIC_USER}\"."; \ + else \ + echo "Adding user \"${RCYNIC_USER}\" failed..."; \ + echo "Please create it, then try again."; \ + exit 1; \ + fi |