summaryrefslogtreecommitdiff
path: root/community/stunnel/stunnel.install
diff options
context:
space:
mode:
Diffstat (limited to 'community/stunnel/stunnel.install')
-rw-r--r--community/stunnel/stunnel.install32
1 files changed, 14 insertions, 18 deletions
diff --git a/community/stunnel/stunnel.install b/community/stunnel/stunnel.install
index f7bbbffcb..d9998e4da 100644
--- a/community/stunnel/stunnel.install
+++ b/community/stunnel/stunnel.install
@@ -1,35 +1,31 @@
post_install() {
# add stunnel group
- if [ ! `grep stunnel /etc/group` ]; then
- groupadd -g 16 stunnel &>/dev/null
+ if ! getent group stunnel >/dev/null 2>&1; then
+ groupadd -g 16 stunnel
fi
# add stunnel user
- id stunnel &>/dev/null || \
+ if ! getent passwd stunnel >/dev/null 2>&1; then
useradd -u 16 -g stunnel -d /var/run/stunnel -s /bin/false stunnel
-
+ fi
+
# create chroot dir if necessary.
if [ ! -d /var/run/stunnel ]; then
- install -d -m 770 -o stunnel -g stunnel /var/run/stunnel
+ install -dm770 -o stunnel -g stunnel /var/run/stunnel
fi
-
- cat << EOF
-
-NOTE
-----
-Copy /etc/stunnel/stunnel.conf-sample to /etc/stunnel/stunnel.conf
-& edit it to match your setup before invoking the daemon (/etc/rc.d/stunnel).
-
-EOF
}
post_upgrade() {
- post_install $1
+ post_install "$@"
}
pre_remove() {
# remove users & groups
- userdel stunnel &> /dev/null
- groupdel stunnel &> /dev/null
- rm -rf /var/run/stunnel
+ if getent passwd stunnel >/dev/null 2>&1; then
+ userdel stunnel
+ fi
+
+ if getent group stunnel >/dev/null 2>&1; then
+ groupdel stunnel
+ fi
}