From 99b21dbe8e134fbb77899e218c22a69830e73e8d Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Fri, 3 Jul 2026 15:01:48 +0100 Subject: stores src in $HOME and more perm tweaks --- install.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'install.sh') 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