mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-25 10:03:03 +01:00
5a41962c79
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
50 lines
668 B
Bash
50 lines
668 B
Bash
#!/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
|