mirror of https://github.com/sfeakes/AqualinkD.git
Update
parent
fa5ea8e85c
commit
d182784ae2
|
@ -30,9 +30,10 @@ REMOUNT_RO=1
|
|||
TRUE=0
|
||||
FALSE=1
|
||||
|
||||
_logfile="";
|
||||
_frommake=$FALSE;
|
||||
_ignorearch=$FALSE;
|
||||
_logfile=""
|
||||
_frommake=$FALSE
|
||||
_ignorearch=$FALSE
|
||||
_nosystemd=$FALSE
|
||||
|
||||
log()
|
||||
{
|
||||
|
@ -59,7 +60,7 @@ printHelp()
|
|||
}
|
||||
|
||||
|
||||
log "Called $0 with $*"
|
||||
#log "Called $0 with $*"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
|
@ -83,6 +84,9 @@ while [[ $# -gt 0 ]]; do
|
|||
ignorearch)
|
||||
_ignorearch=$TRUE
|
||||
;;
|
||||
nosystemd)
|
||||
_nosystemd=$TRUE
|
||||
;;
|
||||
help | -help | --help | -h)
|
||||
printHelp
|
||||
exit $TRUE;
|
||||
|
@ -170,9 +174,11 @@ fi
|
|||
# Exit if we can't find systemctl
|
||||
command -v systemctl >/dev/null 2>&1 || { log "This script needs systemd's systemctl manager, Please check path or install manually" >&2; exit 1; }
|
||||
|
||||
# stop service, hide any error, as the service may not be installed yet
|
||||
systemctl stop $SERVICE > /dev/null 2>&1
|
||||
SERVICE_EXISTS=$(echo $?)
|
||||
if [ "$_nosystemd" -eq $FALSE ]; then
|
||||
# stop service, hide any error, as the service may not be installed yet
|
||||
systemctl stop $SERVICE > /dev/null 2>&1
|
||||
SERVICE_EXISTS=$(echo $?)
|
||||
fi
|
||||
|
||||
# Clean everything if requested.
|
||||
if [ "$1" == "clean" ]; then
|
||||
|
@ -287,6 +293,11 @@ fi
|
|||
# remount root ro
|
||||
if [[ $REMOUNT_RO -eq 0 ]]; then
|
||||
mount / -o remount,ro &>/dev/null
|
||||
log "Root filesystem remounted RO"
|
||||
fi
|
||||
|
||||
if [ "$_nosystemd" -eq $TRUE ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
systemctl enable $SERVICE
|
||||
|
|
|
@ -45,6 +45,7 @@ log()
|
|||
echo "$*"
|
||||
|
||||
if [ "$SYSTEMD_LOG" -eq $TRUE ]; then
|
||||
# For some unknown reason, only way below works from aqualinkd process is adding "&>> "$OUTPUT""
|
||||
echo "Upgrade: $*" | systemd-cat -t aqualinkd -p info &>> "$OUTPUT"
|
||||
else
|
||||
logger -p local0.notice -t aqualinkd "Upgrade: $*"
|
||||
|
|
Loading…
Reference in New Issue