headscale-tailscale-replace.../farmq-admin/static/novnc/snap/local/svc_wrapper.sh
시골약사 c37cf023c1 사이드바 브랜딩을 PharmQ Super Admin (PSA)로 업데이트
- base.html 상단 네비게이션 브랜딩 변경
- 팜큐 약국 관리 시스템 → PharmQ Super Admin (PSA)
- UI 일관성 향상을 위한 브랜딩 통합

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 13:45:29 +09:00

30 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# `snapctl get services` returns a JSON array, example:
#{
#"n6801": {
# "listen": 6801,
# "vnc": "localhost:5901"
#},
#"n6802": {
# "listen": 6802,
# "vnc": "localhost:5902"
#}
#}
snapctl get services | jq -c '.[]' | while read service; do # for each service the user sepcified..
# get the important data for the service (listen port, VNC host:port)
listen_port="$(echo $service | jq --raw-output '.listen')"
vnc_host_port="$(echo $service | jq --raw-output '.vnc')" # --raw-output removes any quotation marks from the output
# check whether those values are valid
expr "$listen_port" : '^[0-9]\+$' > /dev/null
listen_port_valid=$?
if [ ! $listen_port_valid ] || [ -z "$vnc_host_port" ]; then
# invalid values mean the service is disabled, do nothing except for printing a message (logged in /var/log/system or systemd journal)
echo "novnc: not starting service ${service} with listen_port ${listen_port} and vnc_host_port ${vnc_host_port}"
else
# start (and fork with '&') the service using the specified listen port and VNC host:port
$SNAP/novnc_proxy --listen $listen_port --vnc $vnc_host_port &
fi
done