mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-01 10:57:47 +00:00
ucentral-client: fix init script file handling
Add file existence checks before reading gateway.json and initialise variables to prevent boot log spam when configuration file doesn't exist. Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -42,8 +42,10 @@ start_service() {
|
||||
[ "${selfsigned}" == "true" ] && insecure=1
|
||||
fi
|
||||
|
||||
server=$(cat /etc/ucentral/gateway.json | jsonfilter -e '@["server"]')
|
||||
port=$(cat /etc/ucentral/gateway.json | jsonfilter -e '@["port"]')
|
||||
server=
|
||||
[ -f /etc/ucentral/gateway.json ] && server=$(cat /etc/ucentral/gateway.json | jsonfilter -e '@["server"]')
|
||||
port=
|
||||
[ -f /etc/ucentral/gateway.json ] && 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)
|
||||
|
||||
Reference in New Issue
Block a user