mirror of
https://git.proxmox.com/git/systemd
synced 2026-01-04 02:36:02 +00:00
resolved: use DPKG_ROOT and make postinst shellcheck-happy
This commit is contained in:
parent
7129300f3c
commit
68f64dc69a
10
debian/systemd-resolved.postinst
vendored
10
debian/systemd-resolved.postinst
vendored
@ -6,15 +6,15 @@ _adopt_conffile() {
|
||||
conffile=$1
|
||||
pkg=$2
|
||||
|
||||
[ -f ${conffile}.dpkg-bak ] || return 0
|
||||
[ -f "${conffile}.dpkg-bak" ] || return 0
|
||||
|
||||
md5sum="$(md5sum ${conffile} | sed -e 's/ .*//')"
|
||||
old_md5sum="$(dpkg-query -W -f='${Conffiles}' $pkg | \
|
||||
md5sum="$(md5sum "${conffile}" | sed -e 's/ .*//')"
|
||||
old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$pkg" | \
|
||||
sed -n -e "\' ${conffile} ' { s/ obsolete$//; s/.* //; p }")"
|
||||
# On new installs, if the policy file was preserved on systemd upgrade
|
||||
# by dpkg-maintscript helper, copy it back if the new file has not been modified yet
|
||||
if [ "$md5sum" = "$old_md5sum" ]; then
|
||||
mv ${conffile}.dpkg-bak ${conffile}
|
||||
mv "${conffile}.dpkg-bak" "${conffile}"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ _adopt_conffile() {
|
||||
if [ "$1" = configure ] && [ -z "$2" ]; then
|
||||
adduser --quiet --system --group --no-create-home --home /run/systemd \
|
||||
--gecos "systemd Resolver" systemd-resolve
|
||||
_adopt_conffile /etc/systemd/resolved.conf systemd-resolved
|
||||
_adopt_conffile "${DPKG_ROOT}/etc/systemd/resolved.conf" systemd-resolved
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
Loading…
Reference in New Issue
Block a user