diff options
Diffstat (limited to 'setup.sh')
| -rwxr-xr-x | setup.sh | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -30,6 +30,11 @@ if grep -rl "server_name.*pestrel\.com" /etc/nginx/ 2>/dev/null; then CONFLICT=1 fi +if grep -rl "server_name.*radar\.pestrel\.com" /etc/nginx/ 2>/dev/null; then + echo "WARNING: The above nginx config(s) already reference radar.pestrel.com — check for duplicate server blocks." + CONFLICT=1 +fi + if grep -rl "listen.*80.*default_server" /etc/nginx/ 2>/dev/null; then echo "WARNING: The above nginx config(s) define a default_server on port 80 — may intercept traffic intended for this site." CONFLICT=1 @@ -55,30 +60,41 @@ install -d /srv/www install -d -o "$OWNER" -g "$OWNER" /srv/www/pestrel chown "$OWNER:$OWNER" /srv/www/pestrel +install -d -o "$OWNER" -g "$OWNER" /opt/radar +install -d -o "$OWNER" -g "$OWNER" /var/lib/radar +install -d -o "$OWNER" -g "$OWNER" /srv/www/radar + # --------------------------------------------------------------------------- # Web content # --------------------------------------------------------------------------- echo "==> Writing index.html..." install -o "$OWNER" -g "$OWNER" -m 644 "$SCRIPT_DIR/index.html" /srv/www/pestrel/index.html +install -o "$OWNER" -g "$OWNER" -m 644 "$SCRIPT_DIR/radar.index.html" /srv/www/radar/index.html + +echo "==> Installing radarFetch.sh..." +install -o "$OWNER" -g "$OWNER" -m 755 "$SCRIPT_DIR/radarFetch.sh" /opt/radar/radarFetch.sh # --------------------------------------------------------------------------- # Systemd units # --------------------------------------------------------------------------- echo "==> Installing systemd unit files..." -for unit in synoptic.service synoptic.timer synoptic-retry.service synoptic-retry.timer; do +for unit in synoptic.service synoptic.timer synoptic-retry.service synoptic-retry.timer \ + radar.service radar.timer radar-retry.service radar-retry.timer; do install -m 644 "$SCRIPT_DIR/systemd/${unit}" "/etc/systemd/system/${unit}" echo " installed ${unit}" done -echo "==> Reloading systemd and enabling timer..." +echo "==> Reloading systemd and enabling timers..." systemctl daemon-reload systemctl enable --now synoptic.timer +systemctl enable --now radar.timer # --------------------------------------------------------------------------- # Nginx # --------------------------------------------------------------------------- -#echo "==> Installing nginx config..." -#install -m 644 "$SCRIPT_DIR/nginx/pestrel.com.conf" /etc/nginx/conf.d/synoptic.conf +#echo "==> Installing nginx configs..." +#install -m 644 "$SCRIPT_DIR/nginx/pestrel.com.conf" /etc/nginx/conf.d/synoptic.conf +#install -m 644 "$SCRIPT_DIR/nginx/radar.pestrel.com.conf" /etc/nginx/conf.d/radar.conf #echo "==> Testing nginx config..." #nginx -t |
