diff options
| author | Joe Carstairs <me@joeac.net> | 2026-07-03 15:01:48 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-07-03 15:01:48 +0100 |
| commit | 99b21dbe8e134fbb77899e218c22a69830e73e8d (patch) | |
| tree | 915922262b687aaf42c2fb4ae90a7450c8391901 /install.sh | |
| parent | 3af454683946a00772979a5dc88b53311be05612 (diff) | |
stores src in $HOME and more perm tweaks
Diffstat (limited to 'install.sh')
| -rw-r--r-- | install.sh | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -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 |
