From: Martin-Éric RACINE <57731134+perkelix@users.noreply.github.com> Date: Sun, 8 Dec 2024 09:49:44 +0000 (+0200) Subject: Exit the timesyncd hook if not on systemd and not executable (#398) (#403) X-Git-Tag: v10.2.0~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25689325f81c7a61bd48f5727eaae1d6f16e1328;p=thirdparty%2Fdhcpcd.git Exit the timesyncd hook if not on systemd and not executable (#398) (#403) Exit the timesyncd hook immediately if not running on a systemd host AND timesyncd is not executable. --- diff --git a/hooks/50-timesyncd.conf b/hooks/50-timesyncd.conf index dff88173..8ee722bd 100644 --- a/hooks/50-timesyncd.conf +++ b/hooks/50-timesyncd.conf @@ -1,3 +1,10 @@ +if [ ! -d /run/systemd/system ]; then + return +fi +if [ ! -x /lib/systemd/systemd-timesyncd ]; then + return +fi + : ${timesyncd_conf_d:=/run/systemd/timesyncd.conf.d} timesyncd_conf="${timesyncd_conf_d}/dhcpcd-$ifname.conf" timesyncd_tmp_d="$state_dir/timesyncd"