summaryrefslogtreecommitdiff
path: root/community/darkstat/darkstat.install
diff options
context:
space:
mode:
Diffstat (limited to 'community/darkstat/darkstat.install')
-rw-r--r--community/darkstat/darkstat.install20
1 files changed, 20 insertions, 0 deletions
diff --git a/community/darkstat/darkstat.install b/community/darkstat/darkstat.install
new file mode 100644
index 000000000..246bfd808
--- /dev/null
+++ b/community/darkstat/darkstat.install
@@ -0,0 +1,20 @@
+daemon_name=darkstat
+daemon_chroot=var/darkstat
+
+post_install() {
+ if [ ! -d "$daemon_chroot" ]; then
+ install -d "$daemon_chroot"
+ touch "$daemon_chroot/darkstat.dat"
+ fi
+ useradd \
+ --system \
+ --home /"$daemon_chroot" \
+ --shell /bin/false \
+ --no-user-group \
+ --gid nobody "$daemon_name"
+ chown -R "$daemon_name":nobody "/$daemon_chroot"
+}
+
+post_remove() {
+ userdel "$daemon_name"
+}