From 7d00fa1dbe8a6d6b4ed8042a6f78011794068e0b Mon Sep 17 00:00:00 2001 From: Anj Duvnjak Date: Thu, 20 Oct 2022 20:47:44 +0700 Subject: network/ifplugd: Added (Network Daemon). Signed-off-by: Willy Sudiarto Raharjo --- network/ifplugd/doinst.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 network/ifplugd/doinst.sh (limited to 'network/ifplugd/doinst.sh') diff --git a/network/ifplugd/doinst.sh b/network/ifplugd/doinst.sh new file mode 100644 index 0000000000000..ff6f992fef0f6 --- /dev/null +++ b/network/ifplugd/doinst.sh @@ -0,0 +1,24 @@ +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.ifplugd.new +config etc/ifplugd/ifplugd.conf.new +config etc/ifplugd/ifplugd.action.new -- cgit v1.2.3