|
Alec Leamas |
53cfcb9 |
#!/bin/bash
|
|
Alec Leamas |
53cfcb9 |
#
|
|
Alec Leamas |
53cfcb9 |
# If iguanaIR runs, signal HUP to start a rescan. If not started, or
|
|
Alec Leamas |
53cfcb9 |
# signal fails, try-restart daemon.
|
|
Alec Leamas |
53cfcb9 |
|
|
Alec Leamas |
53cfcb9 |
if systemctl --quiet is-active iguanaIR.service; then
|
|
Alec Leamas |
53cfcb9 |
pid=$( systemctl --property=MainPID show iguanaIR.service ) || \
|
|
Alec Leamas |
53cfcb9 |
pid=''
|
|
Alec Leamas |
53cfcb9 |
pid=${pid##*=}
|
|
Alec Leamas |
53cfcb9 |
[ -n "$pid" ] && kill -HUP $pid &>/dev/null && exit 0
|
|
Alec Leamas |
53cfcb9 |
fi
|
|
Alec Leamas |
53cfcb9 |
systemctl try-restart iguanaIR.service
|