summaryrefslogtreecommitdiff
path: root/community/stunnel/stunnel.install
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-07-19 01:10:32 -0700
committerroot <root@rshg054.dnsready.net>2013-07-19 01:10:32 -0700
commit8fbc0076a4827ddc6af92e0b9daa4c4c31450808 (patch)
tree03fd0e2921ebd53228d9a93e32ed3976b636cbea /community/stunnel/stunnel.install
parente445a313723389ba9ee1fded025c567dae5b21ea (diff)
Fri Jul 19 01:09:18 PDT 2013
Diffstat (limited to 'community/stunnel/stunnel.install')
-rw-r--r--community/stunnel/stunnel.install31
1 files changed, 31 insertions, 0 deletions
diff --git a/community/stunnel/stunnel.install b/community/stunnel/stunnel.install
new file mode 100644
index 000000000..d9998e4da
--- /dev/null
+++ b/community/stunnel/stunnel.install
@@ -0,0 +1,31 @@
+post_install() {
+ # add stunnel group
+ if ! getent group stunnel >/dev/null 2>&1; then
+ groupadd -g 16 stunnel
+ fi
+
+ # add stunnel user
+ 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 -dm770 -o stunnel -g stunnel /var/run/stunnel
+ fi
+}
+
+post_upgrade() {
+ post_install "$@"
+}
+
+pre_remove() {
+ # remove users & groups
+ if getent passwd stunnel >/dev/null 2>&1; then
+ userdel stunnel
+ fi
+
+ if getent group stunnel >/dev/null 2>&1; then
+ groupdel stunnel
+ fi
+}