Skip to content

Commit

Permalink
change AP_isRunning to APLog_isRunning
Browse files Browse the repository at this point in the history
  • Loading branch information
MusclePr committed May 17, 2024
1 parent 5a0a1a7 commit cc2de45
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/helper_autopause.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,26 @@ APLog_init() {
echo -n "$$" > ${APLog_pid}
}

APLog_isRunning() {
test -e ${APLog_pid} && test -p "${APLog_pipe}"
}

#-------------------------------
# AutoPause Core
#-------------------------------

AP_startDaemon() {
autopaused-ctl start
local pid
pid=$(pidof knockd)
APLog_debug "Start knockd pid:${pid}"
}

AP_stopDaemon() {
local pid
pid=$(pidof knockd)
if [ ! "${pid}" = "" ]; then
APLog_debug "Stop knockd pid:${pid}"
APLog_debug "Stop knockd pid:${pid}"
if [ -n "${pid}" ]; then
autopaused-ctl stop
fi
}
Expand All @@ -124,10 +129,6 @@ AP_isEnabled() {
isTrue "${AUTO_PAUSE_ENABLED}"
}

AP_isRunning() {
pidof ""
}

AP_isPaused() {
test -e "${AP_pause_file}"
}
Expand Down Expand Up @@ -333,7 +334,7 @@ AutoPause_waitWakeup() {
#-------------------------------

AutoPauseEx_isEnabled() {
AP_isEnabled && test -e "${APLog_pid}"
AP_isEnabled && APLog_isRunning
}

AutoPauseEx_resume() {
Expand Down

0 comments on commit cc2de45

Please sign in to comment.