diff options
Diffstat (limited to 'recipes-kernel/rs9113/rs9113-1.3.0/rs9113.init')
-rwxr-xr-x | recipes-kernel/rs9113/rs9113-1.3.0/rs9113.init | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/recipes-kernel/rs9113/rs9113-1.3.0/rs9113.init b/recipes-kernel/rs9113/rs9113-1.3.0/rs9113.init new file mode 100755 index 0000000..91ea057 --- /dev/null +++ b/recipes-kernel/rs9113/rs9113-1.3.0/rs9113.init @@ -0,0 +1,64 @@ +#!/bin/bash +# Note that none of the INIT stuff below works in the current open-embedded. +### BEGIN INIT INFO +# Provides: rs9113 +# Required-Start: mts-io +# Default-Start: S +# Default-Stop: 0 6 +# X-Start-Before: networking +# Short-Description: load the rs9113 drivers +# Description: rs9113 drivers are used to provide access to Bluetooth +# and WiFi. +### END INIT INFO + +CONFIG=/etc/default/rs9113 + +[ -f $CONFIG ] || exit 1 + +. $CONFIG + +case "$1" in + start) + /usr/bin/logger -t "rs9113" -p info -s "Loading rs9113 modules" + /usr/sbin/rs9113_load_modules.sh $COEXISTENCE + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + + stop) + /usr/bin/logger -t "rs9113" -p info -s "Unloading rs9113 modules" + /usr/sbin/rs9113_remove_modules.sh + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + for dir in /sys/class/net/rpine[0-9]* ; do + if [[ -d ${dir} ]] ; then + echo Driver is loaded + exit 0 + fi + done + echo Driver is not loaded + exit 3 + ;; + *) + "Usage: $0 {start|stop|status|restart}" + exit 2 + ;; +esac + +exit 0 + |