summaryrefslogtreecommitdiff
path: root/bareos/bareos-common.install
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-02-25 15:40:41 +0100
committerErich Eckner <git@eckner.net>2019-02-25 15:40:41 +0100
commitcbc416a25d57f5541531186b402d8df9400de179 (patch)
treea6233243e6a912b72bcbb085e3cced26aaefb404 /bareos/bareos-common.install
parent8949a82c8aa34b44a06fef23f3cc1f3f5c6010d6 (diff)
downloadarchlinuxewe.git.save-cbc416a25d57f5541531186b402d8df9400de179.tar.xz
bareos new
Diffstat (limited to 'bareos/bareos-common.install')
-rw-r--r--bareos/bareos-common.install31
1 files changed, 31 insertions, 0 deletions
diff --git a/bareos/bareos-common.install b/bareos/bareos-common.install
new file mode 100644
index 00000000..42615708
--- /dev/null
+++ b/bareos/bareos-common.install
@@ -0,0 +1,31 @@
+# arg 1: the new package version
+pre_install() {
+ # Create User/Group
+ getent group bareos > /dev/null || groupadd --system bareos
+ getent passwd bareos > /dev/null || useradd --system --gid bareos \
+ --home-dir /var/lib/bareos --no-create-home bareos
+
+}
+
+# arg 1: the new package version
+post_install() {
+ chown bareos:bareos /var/lib/bareos/
+ chown bareos:bareos /run/bareos/
+ #chown bareos:bareos /var/log/bareos/
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+pre_upgrade() {
+ pre_install
+}
+
+post_upgrade() {
+ post_install
+}
+
+# arg 1: the old package version
+post_remove() {
+ getent passwd bareos > /dev/null && userdel bareos
+ rm -f /etc/bareos/.rndpwd
+}