feat(codex): publish Guanghu OS server navigator
This commit is contained in:
parent
2ee684bf61
commit
63a9236e9b
13 changed files with 941 additions and 0 deletions
24
skills/codex/guanghu-os-server/scripts/authorize.sh
Executable file
24
skills/codex/guanghu-os-server/scripts/authorize.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "usage: authorize.sh <registered-action>" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "${GH_OS_TARGET:-BS-SH-005}" != "BS-SH-005" ]; then
|
||||
echo "STANDING_AUTHORIZATION_NOT_VALID_FOR_TARGET target=${GH_OS_TARGET}" >&2
|
||||
exit 65
|
||||
fi
|
||||
|
||||
target_alias="${GH_OS_SSH_ALIAS:-guanghu-os-bs-sh-005}"
|
||||
ssh_config="${GH_OS_SSH_CONFIG:-/Users/bingshuolingdianyuanhe/.ssh/guanghu-os-bs-sh-005.conf}"
|
||||
action="$1"
|
||||
|
||||
exec ssh \
|
||||
-F "$ssh_config" \
|
||||
-o BatchMode=yes \
|
||||
-o ConnectTimeout=10 \
|
||||
-o StrictHostKeyChecking=yes \
|
||||
"$target_alias" \
|
||||
"sudo -n /guanghu/bin/ghctl authorize /guanghu/current '$action'"
|
||||
Loading…
Reference in a new issue