summarylogtreecommitdiffstats
path: root/aegir.install
diff options
context:
space:
mode:
authorJames An2015-02-26 22:04:44 -0500
committerJames An2015-06-30 07:27:49 -0400
commit9175e9ffd307a1e7077178fd3ee7a97ca98fb78a (patch)
tree63560e182aa59d97e8144a6af7b9230790e7e2c3 /aegir.install
parenta2fe1bd219e5378df61adfd9d7004d36124e0a54 (diff)
downloadaur-9175e9ffd307a1e7077178fd3ee7a97ca98fb78a.tar.gz
Changed aegir package to further automate basic configuration of such a web server.
Diffstat (limited to 'aegir.install')
-rw-r--r--aegir.install18
1 files changed, 5 insertions, 13 deletions
diff --git a/aegir.install b/aegir.install
index 68955a0e5d0..63e4e0c3d84 100644
--- a/aegir.install
+++ b/aegir.install
@@ -6,8 +6,8 @@ post_install() {
echo " grep --quiet $(resolveip $(hostname) | cut --fields=6 --delimiter=' ') && echo Success!"
echo ">>> 2. Ensure the http user and group exist (i.e. uid=gid=33):"
echo " $ test \$(id --user http) -eq 33 -a \$(id --group http) -eq 33 && echo Success!"
- echo ">>> 3. Ensure PHP can successfully send outgoing emails:"
- echo " $ php -R 'mail("example@example.com", "Test email from PHP", "Test email body.");
+ echo ">>> 3. Ensure PHP can successfully send outgoing emails (the supplied msmtprc template works for Google accounts):"
+ echo " $ php -R 'mail(\"example@example.com\", \"Test email from PHP\", \"Test email body.\");"
echo ">>> 4. Setup the MySQL instance (by running mysql_secure_installation, or the following shell commands):"
echo " # systemctl start mysqld"
echo " $ mysql --user=root --execute=\""
@@ -33,24 +33,16 @@ post_install() {
}
post_upgrade() {
- if ! getent group aegir &>/dev/null; then
- groupadd --non-unique --gid $(id --group http) aegir
- # Rearrange group database so aegir group name comes before http
- cat \
- <(sed -n '/http:/q;p' /etc/group) \
- <(tail -n1 /etc/group) \
- <(sed -n '/http:/{p;q}' /etc/group) \
- <(head -n-1 /etc/group | sed '1,/http:/d')
- grpconv
- fi
+ TEMPFILE="$(mktemp)"
if ! getent passwd aegir &>/dev/null; then
useradd --non-unique --uid $(id --user http) --gid $(id --group http) --home-dir /var/lib/aegir aegir
# Rearrange user database so aegir user name comes before http
- cat \
+ cat >| $TEMPFILE \
<(sed -n '/http:/q;p' /etc/passwd) \
<(tail -n1 /etc/passwd) \
<(sed -n '/http:/{p;q}' /etc/passwd) \
<(head -n-1 /etc/passwd | sed '1,/http:/d')
+ cp $TEMPFILE /etc/passwd
pwconv
fi
}