r/samba-dc: sysvolsync: Fix running on fresh DC

On a new DC, the `idmap.ldb` file does not yet exist the first time
`sysvolsync` runs.  This causes a syntax error in the condition that
checks the modification timestamp of the file.
chrony
Dustin 2023-10-28 09:52:24 -05:00
parent c814007c6d
commit 3e70600691
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ debug "Copying idmap.ldb from ${pdc}"
rsync -a${DEBUG+i} --delete "${pdc}:${IDMAP_LDB}.bak" "${IDMAP_LDB}.new" rsync -a${DEBUG+i} --delete "${pdc}:${IDMAP_LDB}.bak" "${IDMAP_LDB}.new"
st_new=$(stat -c %Y "${IDMAP_LDB}.new") st_new=$(stat -c %Y "${IDMAP_LDB}.new")
st_cur=$(stat -c %Y "${IDMAP_LDB}") st_cur=$(stat -c %Y "${IDMAP_LDB}")
if [ "${st_new}" -ne "${st_cur}" ]; then if [ -z "${st_cur}" ] || [ "${st_new}" != "${st_cur}" ]; then
info "Got updated idmap.ldb from ${pdc}" info "Got updated idmap.ldb from ${pdc}"
info 'Stopping Samba service' info 'Stopping Samba service'
systemctl stop samba || exit systemctl stop samba || exit