Skip to content

Commit 2568932

Browse files
authored
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.
1 parent e9e4040 commit 2568932

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hooks/50-timesyncd.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
if [ ! -d /run/systemd/system ]; then
2+
return
3+
fi
4+
if [ ! -x /lib/systemd/systemd-timesyncd ]; then
5+
return
6+
fi
7+
18
: ${timesyncd_conf_d:=/run/systemd/timesyncd.conf.d}
29
timesyncd_conf="${timesyncd_conf_d}/dhcpcd-$ifname.conf"
310
timesyncd_tmp_d="$state_dir/timesyncd"

0 commit comments

Comments
 (0)