summaryrefslogtreecommitdiffstats
path: root/tenshi/tenshi.install
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2009-09-03 00:35:20 +0200
committerFlorian Pritz <bluewind@xssn.at>2009-09-03 00:35:20 +0200
commit1915f7f4e7f79f8e482acf1dd8a963f0b87e490d (patch)
tree64198dd3e15661979e5a0eb4763fca44b1c03d61 /tenshi/tenshi.install
parent20166b1eab5906dbcd01110cb63ebde2df4cd685 (diff)
downloadaur-packages-1915f7f4e7f79f8e482acf1dd8a963f0b87e490d.tar.gz
aur-packages-1915f7f4e7f79f8e482acf1dd8a963f0b87e490d.tar.xz
add tenshi
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'tenshi/tenshi.install')
-rw-r--r--tenshi/tenshi.install42
1 files changed, 42 insertions, 0 deletions
diff --git a/tenshi/tenshi.install b/tenshi/tenshi.install
new file mode 100644
index 0000000..270cd64
--- /dev/null
+++ b/tenshi/tenshi.install
@@ -0,0 +1,42 @@
+# $Id: $
+#
+# Description: post-install script for tenshi
+# Contributor: Ryan Corder <ryanc@greengrey.org>
+#
+
+# arg 1: new package version
+post_install() {
+ # create tenshi user
+ if [ -z "`grep '^tenshi:' /etc/group`" ]; then
+ groupadd tenshi
+ fi
+ if [ -z "`grep '^tenshi:' /etc/passwd`" ]; then
+ useradd -d /var/lib/tenshi -g tenshi -s /bin/false tenshi
+ else
+ usermod -s /bin/false tenshi
+ fi
+
+ # set more secure permissions on config files, etc
+ chown -R tenshi:tenshi /etc/tenshi
+ chmod 640 /etc/tenshi/tenshi.conf
+ chown -R tenshi:tenshi /var/lib/tenshi
+ chmod 750 /var/lib/tenshi
+ chmod -R o-rwx /var/lib/tenshi
+}
+
+# arg 1: new package version
+# arg 2: old package version
+post_upgrade() {
+ post_install $1
+}
+
+# arg 1: old package version
+pre_remove() {
+ userdel tenshi &> /dev/null
+ groupdel tenshi &> /dev/null
+}
+
+op=$1
+shift
+
+$op $*