ucentral-client: prevent client from starting before cloud was discovered

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2025-07-08 09:42:57 +02:00
parent f2b69ce972
commit 066b442247

View File

@@ -44,14 +44,15 @@ start_service() {
server=$(cat /etc/ucentral/gateway.json | jsonfilter -e '@["server"]')
port=$(cat /etc/ucentral/gateway.json | jsonfilter -e '@["port"]')
[ -n "$server" -a -n "$port" ] || return 0
boot_cause=$(cat /tmp/pstore | jsonfilter -e '@["pstore"][-1]'.boot_cause)
[ -z $boot_cause ] && boot_cause=coldboot
procd_open_instance
procd_set_param command "$PROG"
[ -n "$serial" ] && procd_append_param command -S $serial
[ -n "$server" ] && procd_append_param command -s $server
[ -n "$port" ] && procd_append_param command -P $port
procd_append_param command -s $server
procd_append_param command -P $port
[ "$debug" -eq 0 ] || procd_append_param command -d
[ "$insecure" -eq 0 ] || procd_append_param command -i
[ -z "$(mount | grep 'tmpfs on / type tmpfs')" ] || procd_append_param command -r