summaryrefslogtreecommitdiff
path: root/package/privoxy/files
diff options
context:
space:
mode:
Diffstat (limited to 'package/privoxy/files')
-rw-r--r--package/privoxy/files/privoxy.init27
-rw-r--r--package/privoxy/files/privoxy.postinst7
2 files changed, 34 insertions, 0 deletions
diff --git a/package/privoxy/files/privoxy.init b/package/privoxy/files/privoxy.init
new file mode 100644
index 000000000..ab782e9ef
--- /dev/null
+++ b/package/privoxy/files/privoxy.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#PKG privoxy
+#INIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ [[ $privoxy = NO ]] && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -f /etc/privoxy/config ] || exit
+ /usr/sbin/privoxy /etc/privoxy
+ ;;
+stop)
+ pkill privoxy
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit $?
diff --git a/package/privoxy/files/privoxy.postinst b/package/privoxy/files/privoxy.postinst
new file mode 100644
index 000000000..105b430c2
--- /dev/null
+++ b/package/privoxy/files/privoxy.postinst
@@ -0,0 +1,7 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+
+gid=$(get_next_gid)
+add_user privoxy $(get_next_uid) $gid /etc/privoxy
+add_group privoxy $gid
+add_rcconf privoxy privoxy NO