summaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rw-r--r--install.sh27
1 files changed, 15 insertions, 12 deletions
diff --git a/install.sh b/install.sh
index 521c321..a9b7e3a 100644
--- a/install.sh
+++ b/install.sh
@@ -44,22 +44,27 @@ if [ -z "$(grep "\bjoeac.net\b" /etc/group)" ]
then
sudo adduser -D -h /home/joeac.net joeac.net
sudo adduser joeac.net joeac.net
- sudo adduser $(whoami) joeac.net
- su -l $(whoami)
fi
-if ! [ -d /home/joeac.net/joeac.net/.git ]
+if ! ( expr "$(groups joeac.net)" wheel )
then
- sudo -u joeac.net git clone https://git.joeac.net/joeac/joeac.net.git /home/joeac.net/joeac.net
+ sudo adduser joeac.net wheel
fi
-sudo chown joeac.net:joeac.net /home/joeac.net/joeac.net
-sudo chmod 770 /home/joeac.net/joeac.net
-if ! [ -h /usr/local/lib/joeac.net ]
+su -l joeac.net
+if ! [ $(whoami) = "joeac.net" ]
then
- sudo ln -s /home/joeac.net/joeac.net /usr/local/lib/joeac.net
+ echo "Could not log in to user: joeac.net. Log in manually and re-run this script as joeac.net."
+ exit 1
fi
+if ! [ -d /home/joeac.net/joeac.net/.git ]
+then
+ git clone https://git.joeac.net/joeac/joeac.net.git /home/joeac.net/joeac.net
+fi
+sudo chown joeac.net:joeac.net /home/joeac.net/joeac.net
+sudo chmod 770 /home/joeac.netjoeac.net
+
if ! [ -f DIGITALOCEAN_TOKEN ]
then
if [ -z "${DIGITALOCEAN_TOKEN}" ]
@@ -79,8 +84,6 @@ then
unset REMOTE_SMTP_PASSWORD
fi
-sudo -u joeac.net touch /home/joeac.net/joeac.net/.env
-sudo -u joeac.net chmod 760 /home/joeac.net/joeac.net/.env
while read line
do
if expr "${line}" : "[[:alnum:]_]\+=" 1>/dev/null
@@ -106,5 +109,5 @@ do
fi
done </home/joeac.net/joeac.net/example.env
-sudo -u joeac.net make --directory=/home/joeac.net/joeac.net
-sudo -u joeac.net make --directory=/home/joeac.net/joeac.net install
+make --directory=/home/joeac.net/joeac.net
+make --directory=/home/joeac.net/joeac.net install