Remove is_running from init.d script.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -16,14 +16,9 @@ get_pid() {
|
||||
pidof "pihole-FTL"
|
||||
}
|
||||
|
||||
is_running() {
|
||||
ps "$(get_pid)" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
# Start the service
|
||||
start() {
|
||||
if is_running; then
|
||||
if get_pid > /dev/null 2>&1; then
|
||||
echo "pihole-FTL is already running"
|
||||
else
|
||||
# Touch files to ensure they exist (create if non-existing, preserve if existing)
|
||||
@@ -54,11 +49,11 @@ start() {
|
||||
|
||||
# Stop the service
|
||||
stop() {
|
||||
if is_running; then
|
||||
if get_pid > /dev/null 2>&1; then
|
||||
/sbin/resolvconf -d lo.piholeFTL
|
||||
kill "$(get_pid)"
|
||||
for i in {1..5}; do
|
||||
if ! is_running; then
|
||||
if ! get_pid > /dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
|
||||
@@ -67,7 +62,7 @@ stop() {
|
||||
done
|
||||
echo
|
||||
|
||||
if is_running; then
|
||||
if get_pid > /dev/null 2>&1; then
|
||||
echo "Not stopped; may still be shutting down or shutdown may have failed, killing now"
|
||||
kill -9 "$(get_pid)"
|
||||
exit 1
|
||||
@@ -82,7 +77,7 @@ stop() {
|
||||
|
||||
# Indicate the service status
|
||||
status() {
|
||||
if is_running; then
|
||||
if get_pid > /dev/null 2>&1; then
|
||||
echo "[ ok ] pihole-FTL is running"
|
||||
exit 0
|
||||
else
|
||||
|
Reference in New Issue
Block a user