Skip to content

Commit d0f85d4

Browse files
committed
try another fix
1 parent 5a2917a commit d0f85d4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

mycodo/scripts/upgrade_commands.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,11 @@ case "${1:-''}" in
474474
dpkg -i "${INSTALL_FILE}"
475475
rm -rf "${INSTALL_FILE}"
476476

477-
systemctl restart influxd
477+
if pidof systemd > /dev/null; then
478+
systemctl restart influxd
479+
else
480+
printf "Systemd not running. Skipping service management for influxd.\n"
481+
fi
478482
else
479483
printf "Correct version of InfluxDB currently installed (v${CORRECT_VERSION_INSTALL}).\n"
480484
fi
@@ -492,7 +496,11 @@ case "${1:-''}" in
492496
dpkg -i "${CLIENT_FILE}"
493497
rm -rf "${CLIENT_FILE}"
494498

495-
systemctl restart influxd
499+
if pidof systemd > /dev/null; then
500+
systemctl restart influxd
501+
else
502+
printf "Systemd not running. Skipping service management for influxd.\n"
503+
fi
496504
else
497505
printf "Correct version of InfluxDB-Client currently installed (v${CORRECT_VERSION_CLI}).\n"
498506
fi

0 commit comments

Comments
 (0)