rename snowflake systemd service
This commit is contained in:
parent
654047e08a
commit
9702978d0c
@ -35,8 +35,9 @@ function update_script() {
|
|||||||
RELEASE=$(curl -fsSL https://gitlab.torproject.org/api/v4/projects/tpo%2Fanti-censorship%2Fpluggable-transports%2Fsnowflake/releases | jq -r '.[0].tag_name' | sed 's/^v//')
|
RELEASE=$(curl -fsSL https://gitlab.torproject.org/api/v4/projects/tpo%2Fanti-censorship%2Fpluggable-transports%2Fsnowflake/releases | jq -r '.[0].tag_name' | sed 's/^v//')
|
||||||
VERSION_FILE="/home/${SNOWFLAKEUSER}/.${APP}_version"
|
VERSION_FILE="/home/${SNOWFLAKEUSER}/.${APP}_version"
|
||||||
if [[ ! -f "${VERSION_FILE}" ]] || [[ "${RELEASE}" != "$(cat "${VERSION_FILE}")" ]]; then
|
if [[ ! -f "${VERSION_FILE}" ]] || [[ "${RELEASE}" != "$(cat "${VERSION_FILE}")" ]]; then
|
||||||
systemctl stop snowflake-proxy
|
msg_info "Stopping ${APP} Service"
|
||||||
msg_ok "Stopped Service"
|
systemctl stop ${APP}
|
||||||
|
msg_ok "Stopped ${APP} Service"
|
||||||
|
|
||||||
setup_go
|
setup_go
|
||||||
|
|
||||||
@ -50,9 +51,9 @@ function update_script() {
|
|||||||
echo "${RELEASE}" | sudo -H -u ${SNOWFLAKEUSER} bash -c "cd ~ && tee .${APP}_version >/dev/null"
|
echo "${RELEASE}" | sudo -H -u ${SNOWFLAKEUSER} bash -c "cd ~ && tee .${APP}_version >/dev/null"
|
||||||
msg_ok "Updated ${APP} to v${RELEASE}"
|
msg_ok "Updated ${APP} to v${RELEASE}"
|
||||||
|
|
||||||
msg_info "Starting Service"
|
msg_info "Starting ${APP} Service"
|
||||||
systemctl start snowflake-proxy
|
systemctl start ${APP}
|
||||||
msg_ok "Started Service"
|
msg_ok "Started ${APP} Service"
|
||||||
msg_ok "Updated successfully!"
|
msg_ok "Updated successfully!"
|
||||||
else
|
else
|
||||||
msg_ok "No update required. ${APP} is already at v${RELEASE}."
|
msg_ok "No update required. ${APP} is already at v${RELEASE}."
|
||||||
|
|||||||
@ -33,7 +33,7 @@ echo "${RELEASE}" | sudo -H -u ${SNOWFLAKEUSER} bash -c "cd ~ && tee .${APP}_ver
|
|||||||
msg_ok "Built Snowflake Proxy v${RELEASE}"
|
msg_ok "Built Snowflake Proxy v${RELEASE}"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/snowflake-proxy.service
|
cat <<EOF >/etc/systemd/system/${APP}.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Snowflake Proxy Service
|
Description=Snowflake Proxy Service
|
||||||
Documentation=https://snowflake.torproject.org/
|
Documentation=https://snowflake.torproject.org/
|
||||||
@ -52,7 +52,7 @@ RestartSec=10
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
systemctl enable -q --now snowflake-proxy
|
systemctl enable -q --now ${APP}
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user