diff options
author | Andre Barboza <bmg.andre@gmail.com> | 2017-09-15 19:35:51 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-09-15 19:37:57 +0700 |
commit | 5a41962c792ee521928d3be2e0b985f8e1a42125 (patch) | |
tree | 1d58c748d3da74f512df99392910231f46aeef04 /system/displaylink/doinst.sh | |
parent | b819c52d4da97ec188e923e87701bd904f7b930a (diff) | |
download | slackbuilds-5a41962c792ee521928d3be2e0b985f8e1a42125.tar.gz |
system/displaylink: Added (driver for DisplayLink devices).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/displaylink/doinst.sh')
-rw-r--r-- | system/displaylink/doinst.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/system/displaylink/doinst.sh b/system/displaylink/doinst.sh new file mode 100644 index 0000000000..3d95d6b956 --- /dev/null +++ b/system/displaylink/doinst.sh @@ -0,0 +1,25 @@ +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... +} + +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.displaylink.new |