aboutsummaryrefslogtreecommitdiff
path: root/system/displaylink/doinst.sh
diff options
context:
space:
mode:
authorAndre Barboza <bmg.andre@gmail.com>2017-09-15 19:35:51 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-09-15 19:37:57 +0700
commit5a41962c792ee521928d3be2e0b985f8e1a42125 (patch)
tree1d58c748d3da74f512df99392910231f46aeef04 /system/displaylink/doinst.sh
parentb819c52d4da97ec188e923e87701bd904f7b930a (diff)
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.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/system/displaylink/doinst.sh b/system/displaylink/doinst.sh
new file mode 100644
index 000000000000..3d95d6b95622
--- /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