summaryrefslogtreecommitdiff
path: root/community-testing/stunnel/stunnel.install
diff options
context:
space:
mode:
Diffstat (limited to 'community-testing/stunnel/stunnel.install')
-rw-r--r--community-testing/stunnel/stunnel.install35
1 files changed, 35 insertions, 0 deletions
diff --git a/community-testing/stunnel/stunnel.install b/community-testing/stunnel/stunnel.install
new file mode 100644
index 000000000..f7bbbffcb
--- /dev/null
+++ b/community-testing/stunnel/stunnel.install
@@ -0,0 +1,35 @@
+post_install() {
+ # add stunnel group
+ if [ ! `grep stunnel /etc/group` ]; then
+ groupadd -g 16 stunnel &>/dev/null
+ fi
+
+ # add stunnel user
+ id stunnel &>/dev/null || \
+ useradd -u 16 -g stunnel -d /var/run/stunnel -s /bin/false stunnel
+
+ # create chroot dir if necessary.
+ if [ ! -d /var/run/stunnel ]; then
+ install -d -m 770 -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
+}
+
+pre_remove() {
+ # remove users & groups
+ userdel stunnel &> /dev/null
+ groupdel stunnel &> /dev/null
+ rm -rf /var/run/stunnel
+}