diff options
author | Sebastian Arcus <s.arcus@open-t.co.uk> | 2022-11-21 15:01:09 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-11-21 15:01:09 +0700 |
commit | cbb98b27d129ebbed84ab633872946880511cccd (patch) | |
tree | cdb8660e26239aaf76b79f54c7c3913672279595 /system/crelay/doinst.sh | |
parent | df84e15a335d6ef4f5367b023b855954ff9f53ff (diff) |
system/crelay: Added (software for HID and FTDI usb relays).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/crelay/doinst.sh')
-rw-r--r-- | system/crelay/doinst.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/system/crelay/doinst.sh b/system/crelay/doinst.sh new file mode 100644 index 000000000000..9004ee8dfc74 --- /dev/null +++ b/system/crelay/doinst.sh @@ -0,0 +1,14 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/crelay.conf.new |