]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Exit the timesyncd hook if not on systemd and not executable (#398) (#403)
authorMartin-Éric RACINE <57731134+perkelix@users.noreply.github.com>
Sun, 8 Dec 2024 09:49:44 +0000 (11:49 +0200)
committerGitHub <noreply@github.com>
Sun, 8 Dec 2024 09:49:44 +0000 (09:49 +0000)
Exit the timesyncd hook immediately if not running on a systemd host AND timesyncd is not executable.

hooks/50-timesyncd.conf

index dff8817324e3c289cb5b8a5ab71f50ff13ab6d1b..8ee722bda4e4b5b03d9f632ab25e324ffa2d51d9 100644 (file)
@@ -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"