summarylogtreecommitdiffstats
path: root/gogios.install
diff options
context:
space:
mode:
authorBailey Kasin2019-07-23 17:14:12 -0700
committerBailey Kasin2019-07-23 17:14:12 -0700
commit831491188220e625f5004bfbbc3d78e5dc6ef205 (patch)
treef7dc9da2067b4f23fdf4557ac97dbb94ec4762c9 /gogios.install
downloadaur-831491188220e625f5004bfbbc3d78e5dc6ef205.tar.gz
First successful build
Diffstat (limited to 'gogios.install')
-rw-r--r--gogios.install34
1 files changed, 34 insertions, 0 deletions
diff --git a/gogios.install b/gogios.install
new file mode 100644
index 000000000000..b65fc5040178
--- /dev/null
+++ b/gogios.install
@@ -0,0 +1,34 @@
+post_install() {
+ if [ ! -f /etc/gingertechengine/checks.json ]; then
+ echo "Making default check file"
+ mv /etc/gingertechengine/example.json /etc/gingertechengine/checks.json
+ fi
+
+ if [ ! -f /etc/gingertechengine/gogios.toml ]; then
+ echo "Making default config"
+ cp /etc/gingertechengine/gogios.sample.toml /etc/gingertechengine/gogios.toml
+ fi
+
+ if id "gogios" >/dev/null 2>&1; then
+ echo "gogios user already exists"
+ else
+ useradd --system --no-create-home --shell /sbin/nologin gogios
+ fi
+
+ chown gogios:gogios -R /var/log/gingertechnology
+ chown gogios:gogios -R /usr/lib/gingertechengine
+ chown gogios:gogios -R /etc/gingertechengine
+ chown gogios:gogios -R /opt/gingertechengine
+}
+
+post_upgrade() {
+ post_install
+
+ systemctl restart gogios
+}
+
+pre_remove() {
+ systemctl stop gogios
+ systemctl disable gogios
+}
+