Skip to content
activate-user.sh 467 B
Newer Older
Michiel de Jong's avatar
Michiel de Jong committed
#!/bin/bash -eux

Michiel de Jong's avatar
Michiel de Jong committed
if [ $# -ge 2 ]; then
  DOMAIN=$1
  IMAGE=$2
else
  echo "Usage: sh /data/indiehosters/scripts/activate-user.sh domain image [gitrepo]"
Michiel de Jong's avatar
Michiel de Jong committed
  exit 1
fi
mkdir -p /data/domains/$DOMAIN/$IMAGE
Michiel de Jong's avatar
Michiel de Jong committed
if [ $# -ge 3 ]; then
  GITREPO=$3
  echo $GITREPO > /data/domains/$DOMAIN/$IMAGE/GITURL
Michiel de Jong's avatar
Michiel de Jong committed
fi
Michiel de Jong's avatar
Michiel de Jong committed
# Start service for new site (and create the user). This will also enable the git puller.
systemctl enable $IMAGE@$DOMAIN.service
systemctl start  $IMAGE@$DOMAIN.service