summarylogtreecommitdiffstats
path: root/neo4j.install
diff options
context:
space:
mode:
authorMarcel Campello Ferreira2014-02-06 15:53:06 -0200
committerMarcel Campello Ferreira2014-02-06 15:53:06 -0200
commit389a30e463f8c30168df20ef13d0a78a356eb782 (patch)
treeda7ce3c291b3d786fd782b3367f39e3c5960a344 /neo4j.install
parent16677849da56abdae8fafd963c449b93f6124d61 (diff)
downloadaur-389a30e463f8c30168df20ef13d0a78a356eb782.tar.gz
Version 2.0.1-1.
Diffstat (limited to 'neo4j.install')
-rw-r--r--neo4j.install59
1 files changed, 31 insertions, 28 deletions
diff --git a/neo4j.install b/neo4j.install
index fbe06d3eb0a4..97733e3ed09a 100644
--- a/neo4j.install
+++ b/neo4j.install
@@ -1,28 +1,31 @@
- post_install() {
- if ! getent group neo4j >/dev/null; then
- groupadd --system neo4j
- fi
- if ! getent passwd neo4j >/dev/null; then
- useradd --system -g neo4j -d /var/lib/neo4j -s /bin/false neo4j
- fi
-
- chown -R neo4j.neo4j /var/lib/neo4j
- chown -R neo4j.neo4j /var/log/neo4j
- chown -R neo4j.neo4j /etc/neo4j
-
- /usr/bin/systemd-tmpfiles --create neo4j.conf
- }
-
- post_upgrade() {
- post_install $1
- }
-
- post_remove() {
- if getent passwd neo4j >/dev/null; then
- userdel neo4j
- fi
- if getent group neo4j >/dev/null; then
- groupdel neo4j
- fi
- }
- \ No newline at end of file
+assert_user_and_group_exist() {
+ if ! getent group neo4j >/dev/null; then
+ groupadd --system neo4j
+ fi
+ if ! getent passwd neo4j >/dev/null; then
+ useradd --system -g neo4j -d /var/lib/neo4j -s /bin/false neo4j
+ fi
+}
+
+post_install() {
+ assert_user_and_group_exist
+
+ chown -R neo4j.neo4j /var/lib/neo4j
+ chown -R neo4j.neo4j /var/log/neo4j
+ chown -R neo4j.neo4j /etc/neo4j
+
+ /usr/bin/systemd-tmpfiles --create neo4j.conf
+}
+
+post_upgrade() {
+ assert_user_and_group_exist
+}
+
+post_remove() {
+ if getent passwd neo4j >/dev/null; then
+ userdel neo4j
+ fi
+ if getent group neo4j >/dev/null; then
+ groupdel neo4j
+ fi
+}