aboutsummaryrefslogtreecommitdiff
path: root/system/displaylink/rc.displaylink
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/rc.displaylink
parentb819c52d4da97ec188e923e87701bd904f7b930a (diff)
system/displaylink: Added (driver for DisplayLink devices).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/displaylink/rc.displaylink')
-rw-r--r--system/displaylink/rc.displaylink50
1 files changed, 50 insertions, 0 deletions
diff --git a/system/displaylink/rc.displaylink b/system/displaylink/rc.displaylink
new file mode 100644
index 0000000000000..8fd7d9cd479f6
--- /dev/null
+++ b/system/displaylink/rc.displaylink
@@ -0,0 +1,50 @@
+#!/bin/sh
+# Start/stop DisplayLink
+
+PIDFILE=/var/run/displaylink/displaylink.pid
+DAEMON=@INSTALL_PATH@DisplayLinkManager
+
+displaylink_start() {
+ modprobe evdi
+ $DAEMON &
+ PID=$(echo $!)
+ if [ ! -z $PID ]
+ then
+ echo $PID > $PIDFILE
+ fi
+ exit $?
+}
+
+displaylink_stop() {
+ if [ -f $PIDFILE ]
+ then
+ kill -HUP $(cat $PIDFILE)
+ rm -f $PIDFILE
+ fi
+ exit $?
+}
+
+displaylink_restart() {
+ displaylink_start
+ sleep 1
+ displaylink_stop
+}
+
+print_usage() {
+ echo "usage $0 start|stop|restart"
+}
+
+case "$1" in
+ 'start')
+ displaylink_start
+ ;;
+ 'stop')
+ displaylink_stop
+ ;;
+ 'restart')
+ displaylink_restart
+ ;;
+ *)
+ print_usage
+ ;;
+esac