slackbuilds_ponce/network/dnsproxy-bin/doinst.sh
Alexander Verbovetsky 4dfa7f761f network/dnsproxy-bin: Added (DNS Proxy).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2024-02-02 11:05:42 +07:00

23 lines
475 B
Bash

config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
rm $NEW
fi
}
preserve_perms() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ -e $OLD ]; then
cp -a $OLD ${NEW}.incoming
cat $NEW > ${NEW}.incoming
mv ${NEW}.incoming $NEW
fi
config $NEW
}
preserve_perms etc/rc.d/rc.dnsproxy.new
config etc/dnsproxy.yaml.new