sh2/d2ypp2/scripts/linux/refresh_live_console_unit.sh
2026-06-07 00:34:55 -05:00

25 lines
917 B
Bash
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
# git pull 后若改了 systemd 模板(如 live-console 或 Neko watcher),执行本脚本重写对应 unit 并 enable --now
set -euo pipefail
SELF_DIR="$(cd "$(dirname "$0")" && pwd)"
INSTALL_TAG="refresh-unit"
. "$SELF_DIR/lib/common.sh"
ensure_root "$@"
load_env
ensure_live_user
ensure_live_can_traverse_repo_root
configure_host_dns
ensure_runtime_dirs_owned_by_live
log "Rewriting /etc/systemd/system/live-console.service from repo"
install_live_console_service
ensure_runtime_dirs_owned_by_live
log "Rewriting /etc/systemd/system/live-neko-ip-watch.service from repo"
install_neko_ip_watch_service
log "Rewriting /etc/systemd/system/live-wireguard-watch.service from repo"
install_wireguard_watch_service
log "Rewriting /etc/systemd/system/live-frigate-usb-watch.service from repo"
install_frigate_usb_watch_service
log "Done. Check: systemctl status live-console.service --no-pager"