changes for telegraf os.sh

This commit is contained in:
m0duspwnens
2024-01-16 17:03:36 -05:00
parent 8c1d1c95db
commit dff06cb085

View File

@@ -8,19 +8,7 @@
# if this script isn't already running
if [[ ! "`pidof -x $(basename $0) -o %PPID`" ]]; then
NEEDS_RESTART=0
if which needs-restarting &> /dev/null; then
# DNF/RPM family
if ! needs-restarting -r &> /dev/null; then
NEEDS_RESTART=1
fi
else
# APT family
if [ -f /var/run/reboot-required ]; then
NEEDS_RESTART=1
fi
fi
NEEDS_RESTART=$(cat /var/log/sostatus/needs-restarted)
echo "os restart=$NEEDS_RESTART"