summarylogtreecommitdiffstats
path: root/aegir.install
diff options
context:
space:
mode:
authorJames An2015-08-08 12:44:31 -0400
committerJames An2015-08-08 12:45:06 -0400
commit36fb191227e41d766d735c06a360ec886efa6d4b (patch)
treeacde7514d57a1fcdcb4e393b3e86318d191669c6 /aegir.install
parent25308412674311161996c11361370db1fbc85670 (diff)
downloadaur-36fb191227e41d766d735c06a360ec886efa6d4b.tar.gz
Changed the aegir root to be inside the /usr/share/webapps folder, changed the Aegir user to share UID with the HTTP user, and set up Aegir setup process to only require a couple of shell commands.
Diffstat (limited to 'aegir.install')
-rw-r--r--aegir.install6
1 files changed, 6 insertions, 0 deletions
diff --git a/aegir.install b/aegir.install
index 71ffeb978c0..9b238f9890e 100644
--- a/aegir.install
+++ b/aegir.install
@@ -4,6 +4,10 @@ post_install() {
echo "User already exists; no action taken."
} || {
useradd --gid $(id --group http) --home-dir /usr/share/webapps/aegir --non-unique --uid $(id --user http) aegir
+ # Replace /etc/passwd with itself having the Aegir user rearranged above the HTTP user.
+ tempfile=$(mktemp)
+ cat <(sed -n '1,/^http/p' /etc/passwd | head -n-1) <(getent passwd aegir) <(sed -n '/^http/,$p' /etc/passwd | head -n-1) >| $tempfile
+ install -m644 $tempfile /etc/passwd
echo "Done."
}
@@ -56,4 +60,6 @@ post_upgrade() {
pre_remove() {
[ $(systemctl --system is-enabled aegir.target) = enabled ] && systemctl --system disable --now aegir.target
[ $(systemctl --system is-active aegir.target) = enabled ] && systemctl --system stop --now aegir.target
+ [ $(getent passwd aegir &>/dev/null; echo $?) -eq 0 ] && userdel aegir
+ echo ">>> There are still files related to Aegir at: /usr/share/webapps/aegir."
}