Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

fix(heartbeat): use parseable multiline shell case statements

rahmaneffb2b13bdbf93
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 719306b8..48b7ac83 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -8,6 +8,7 @@ this is the *what*, and it is what Settings → Account → About shows as “Wh
**Fixed**
+- `heartbeat` use parseable multiline shell case statements
- `build` keep guarded host runtime paths out of asset tracing
- `security` close resource and launcher gaps and repair gates
- `security` inspect ZIP output through pinned descriptor
diff --git a/scripts/lib/heartbeat-cron.sh b/scripts/lib/heartbeat-cron.sh
index 4eb53272..5c2185f7 100644
--- a/scripts/lib/heartbeat-cron.sh
+++ b/scripts/lib/heartbeat-cron.sh
@@ -4,7 +4,11 @@ heartbeat_cron_quote() { printf "'%s'" "${1//\'/\'\\\'\'}"; }
heartbeat_cron() {
local action="$1" minutes="${OS_HEARTBEAT_INTERVAL_MINUTES:-30}" schedule marker old entry cron_path
command -v crontab >/dev/null || gateway_fail 'crontab is unavailable; use the host supervisor to schedule heartbeat'
- case "$minutes" in 1|2|3|5|10|15|20|30) schedule="*/$minutes * * * *" ;; 60) schedule='0 * * * *' ;; *) gateway_fail 'interval must divide an hour (1,2,3,5,10,15,20,30,60)' ;; esac
+ case "$minutes" in
+ 1|2|3|5|10|15|20|30) schedule="*/$minutes * * * *" ;;
+ 60) schedule='0 * * * *' ;;
+ *) gateway_fail 'interval must divide an hour (1,2,3,5,10,15,20,30,60)' ;;
+ esac
[[ "$ROOT$ENVF$PATH" != *$'\n'* ]] || gateway_fail 'cron paths must not contain newlines'
marker="# mso-heartbeat:$KEY"
old="$(crontab -l 2>/dev/null)" || {
diff --git a/scripts/mso-heartbeat b/scripts/mso-heartbeat
index d9158443..96798926 100755
--- a/scripts/mso-heartbeat
+++ b/scripts/mso-heartbeat
@@ -11,10 +11,16 @@ if [ "$ENVF" != /dev/null ] && { [ -e "$ENVF" ] || [ -L "$ENVF" ]; }; then
set -a; . "$ENVF"; set +a
fi
ACTION="${1:-once}"
-case "$ACTION" in once|install-cron|remove-cron) ;; *) gateway_fail 'usage: mso heartbeat [once|install-cron|remove-cron]' ;; esac
+case "$ACTION" in
+ once|install-cron|remove-cron) ;;
+ *) gateway_fail 'usage: mso heartbeat [once|install-cron|remove-cron]' ;;
+esac
[ "$#" -le 1 ] || gateway_fail 'unexpected arguments'
ENABLED="${OS_HEARTBEAT_ENABLED:-0}"
-case "$ENABLED" in 0|1) ;; *) gateway_fail 'OS_HEARTBEAT_ENABLED must be 0 or 1' ;; esac
+case "$ENABLED" in
+ 0|1) ;;
+ *) gateway_fail 'OS_HEARTBEAT_ENABLED must be 0 or 1' ;;
+esac
if [ "$ENABLED" != 1 ] && [ "$ACTION" != remove-cron ]; then
echo 'heartbeat: disabled (OS_HEARTBEAT_ENABLED=0)'; exit 0
fi