thread-master/deploy/scripts/install-nginx.sh

18 lines
483 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# 安裝/更新 nginx conf需要 sudo
set -euo pipefail
# shellcheck source=_common.sh
source "$(cd "$(dirname "$0")" && pwd)/_common.sh"
SRC="$DEPLOY_DIR/nginx/haixun-dev.conf"
DST="/etc/nginx/conf.d/haixun.conf"
[[ -f "$SRC" ]] || die "missing $SRC"
log "install $SRC$DST"
sudo cp "$SRC" "$DST"
sudo nginx -t
sudo systemctl reload nginx
log "nginx reloaded"
log "驗curl -sI -H 'Host: threads-tool-dev.30cm.net' http://127.0.0.1/api/v1/ping"