mirror of https://github.com/lukechilds/umbrel.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
549 B
31 lines
549 B
#!/usr/bin/env bash
|
|
|
|
STATUS_FILE_PATH="/umbrel-status"
|
|
|
|
service_id="${1}"
|
|
status="${2}"
|
|
error_code="${3}"
|
|
|
|
source /etc/default/umbrel 2> /dev/null
|
|
if [[ -z "${UMBREL_OS:-}" ]]; then
|
|
echo "Skipping status update when not on Umbrel OS"
|
|
exit
|
|
fi
|
|
|
|
if [[ "${service_id}" == "" ]]; then
|
|
echo "Error: Missing ID"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "${status}" == "" ]]; then
|
|
echo "Error: Missing Status"
|
|
exit 1
|
|
fi
|
|
|
|
entry="${service_id}:${status}"
|
|
|
|
if [[ "${error_code}" != "" ]]; then
|
|
entry="${entry}:${error_code}"
|
|
fi
|
|
|
|
echo "${entry}" >> "${STATUS_FILE_PATH}"
|
|
|