@@ -32,38 +32,9 @@ if grep -q "systemctl status openclaw" ~/bin/openclaw-status 2>/dev/null; then
3232 orb -m " $OPENCLAW_VM_NAME " bash -lc " sudo rm -f /etc/systemd/system/openclaw.service && sudo systemctl daemon-reload"
3333 orb -m " $OPENCLAW_VM_NAME " bash -lc " sudo loginctl enable-linger \$ (whoami)"
3434 orb -m " $OPENCLAW_VM_NAME " bash -lc " systemctl --user enable openclaw-gateway.service 2>/dev/null || true"
35- # Mac: fix stale commands
36- cat > ~ /bin/openclaw-status << 'FIXEOF '
37- #!/bin/bash
38- set -e
39- _VM="openclaw-vm"; [ -f "$HOME/bin/.openclaw-vm" ] && source "$HOME/bin/.openclaw-vm" && _VM="${OPENCLAW_VM:-$_VM}"
40- orb -m "$_VM" bash -lc "openclaw gateway status"
41- FIXEOF
42- cat > ~ /bin/openclaw-logs << 'FIXEOF '
43- #!/bin/bash
44- set -e
45- _VM="openclaw-vm"; [ -f "$HOME/bin/.openclaw-vm" ] && source "$HOME/bin/.openclaw-vm" && _VM="${OPENCLAW_VM:-$_VM}"
46- orb -m "$_VM" bash -lc "openclaw logs --follow"
47- FIXEOF
48- cat > ~ /bin/openclaw-restart << 'FIXEOF '
49- #!/bin/bash
50- set -e
51- _VM="openclaw-vm"; [ -f "$HOME/bin/.openclaw-vm" ] && source "$HOME/bin/.openclaw-vm" && _VM="${OPENCLAW_VM:-$_VM}"
52- orb -m "$_VM" bash -lc "openclaw gateway restart"
53- FIXEOF
54- cat > ~ /bin/openclaw-stop << 'FIXEOF '
55- #!/bin/bash
56- set -e
57- _VM="openclaw-vm"; [ -f "$HOME/bin/.openclaw-vm" ] && source "$HOME/bin/.openclaw-vm" && _VM="${OPENCLAW_VM:-$_VM}"
58- orb -m "$_VM" bash -lc "openclaw gateway stop"
59- FIXEOF
60- cat > ~ /bin/openclaw-start << 'FIXEOF '
61- #!/bin/bash
62- set -e
63- _VM="openclaw-vm"; [ -f "$HOME/bin/.openclaw-vm" ] && source "$HOME/bin/.openclaw-vm" && _VM="${OPENCLAW_VM:-$_VM}"
64- orb -m "$_VM" bash -lc "openclaw gateway start"
65- FIXEOF
66- chmod +x ~ /bin/openclaw-status ~ /bin/openclaw-logs ~ /bin/openclaw-restart ~ /bin/openclaw-stop ~ /bin/openclaw-start
35+ # Mac: regenerate all commands
36+ OPENCLAW_LANG=" $_OPENCLAW_LANG " OPENCLAW_VM_NAME=" $OPENCLAW_VM_NAME " \
37+ bash " $OPENCLAW_REPO_DIR /scripts/refresh-mac-commands.sh" 2> /dev/null || true
6738 echo " $MSG_UPDATE_AUTO_UPGRADE_DONE "
6839fi
6940
@@ -77,6 +48,11 @@ echo "$MSG_CMD_UPDATE_UPDATING"
7748
7849echo " $MSG_CMD_UPDATE_STOPPING "
7950orb -m " $OPENCLAW_VM_NAME " bash -lc " openclaw gateway stop"
51+ GATEWAY_STOPPED=true
52+ trap ' if [ "$GATEWAY_STOPPED" = true ]; then
53+ echo "$MSG_CMD_UPDATE_RECOVER"
54+ orb -m "$OPENCLAW_VM_NAME" bash -lc "openclaw gateway start" 2>/dev/null || true
55+ fi' EXIT
8056
8157echo " $MSG_CMD_UPDATE_PULLING "
8258orb -m " $OPENCLAW_VM_NAME " bash -lc " cd ~/openclaw && git fetch --tags --force"
12197
12298if [ " $SANDBOX " = true ]; then
12399 echo " $MSG_CMD_UPDATE_SANDBOX_REBUILD "
124- SANDBOX_OK=false
100+ SANDBOX_OK=true
125101 echo " $MSG_CMD_UPDATE_SANDBOX_BASE "
126- if orb -m " $OPENCLAW_VM_NAME " bash -lc " cd ~/openclaw && sg docker -c './scripts/sandbox-setup.sh'" 2> /dev/null; then
127- SANDBOX_OK=true
102+ if ! orb -m " $OPENCLAW_VM_NAME " bash -lc " cd ~/openclaw && sg docker -c './scripts/sandbox-setup.sh'" 2> /dev/null; then
103+ SANDBOX_OK=false
128104 fi
129105 echo " $MSG_CMD_UPDATE_SANDBOX_COMMON "
130- orb -m " $OPENCLAW_VM_NAME " bash -lc " cd ~/openclaw && sg docker -c './scripts/sandbox-common-setup.sh'" 2> /dev/null || true
106+ if ! orb -m " $OPENCLAW_VM_NAME " bash -lc " cd ~/openclaw && sg docker -c './scripts/sandbox-common-setup.sh'" 2> /dev/null; then
107+ echo " $MSG_CMD_UPDATE_SANDBOX_COMMON_FAIL "
108+ SANDBOX_OK=false
109+ fi
131110 echo " $MSG_CMD_UPDATE_SANDBOX_BROWSER "
132- orb -m " $OPENCLAW_VM_NAME " bash -lc " cd ~/openclaw && sg docker -c './scripts/sandbox-browser-setup.sh'" 2> /dev/null || true
111+ if ! orb -m " $OPENCLAW_VM_NAME " bash -lc " cd ~/openclaw && sg docker -c './scripts/sandbox-browser-setup.sh'" 2> /dev/null; then
112+ echo " $MSG_CMD_UPDATE_SANDBOX_BROWSER_FAIL "
113+ SANDBOX_OK=false
114+ fi
133115 echo " $MSG_CMD_UPDATE_SANDBOX_NOTE "
134- # Save new sandbox build hash only if base build succeeded
116+ # Save new sandbox build hash only if all builds succeeded
135117 if [ " $SANDBOX_OK " = true ]; then
136118 orb -m " $OPENCLAW_VM_NAME " bash -lc " cd ~/openclaw && cat Dockerfile.sandbox Dockerfile.sandbox-browser scripts/sandbox-setup.sh scripts/sandbox-common-setup.sh scripts/sandbox-browser-setup.sh 2>/dev/null | sha256sum | cut -d' ' -f1 > ~/.openclaw/.sandbox-build-hash"
119+ else
120+ echo " $MSG_CMD_UPDATE_SANDBOX_PARTIAL "
137121 fi
138122fi
139123
124+ GATEWAY_STOPPED=false
125+ trap - EXIT
126+
140127echo " $MSG_CMD_UPDATE_STARTING "
141128orb -m " $OPENCLAW_VM_NAME " bash -lc " openclaw gateway start"
142129
130+ # Refresh Mac commands (picks up any wrapper changes)
131+ OPENCLAW_LANG=" $_OPENCLAW_LANG " OPENCLAW_VM_NAME=" $OPENCLAW_VM_NAME " \
132+ bash " $OPENCLAW_REPO_DIR /scripts/refresh-mac-commands.sh" 2> /dev/null || true
133+
143134echo " $MSG_CMD_UPDATE_DONE "
144135if [ " $SANDBOX " = false ]; then
145136 echo " $MSG_CMD_UPDATE_SANDBOX_HINT "
0 commit comments