diff options
author | Anj Duvnjak <alvind11@hotmail.com> | 2022-10-20 20:47:44 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-10-20 20:47:44 +0700 |
commit | 7d00fa1dbe8a6d6b4ed8042a6f78011794068e0b (patch) | |
tree | f6cba8881a7959c6b31fc20446bd57e4f46515b3 /network/ifplugd/doinst.sh | |
parent | 3d9b729316604b7c0b1312ce0f9b24d3d5bd2dea (diff) |
network/ifplugd: Added (Network Daemon).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/ifplugd/doinst.sh')
-rw-r--r-- | network/ifplugd/doinst.sh | 24 |
1 files changed, 24 insertions, 0 deletions
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 |