#!/bin/bash # # slmdm This shell script takes care of starting and stopping # the SmartLink HAMR5600 modem driver. # # Adapted from the script /etc/init.d/alsasound # ( Copyright (c) by Jaroslav Kysela ) # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # # For RedHat 5.0+: # chkconfig: 2345 87 14 # description: slmdm # # modified to visually fit into SuSE 6.0+ by Philipp Thomas # further improvements by Bernd Kaindl, Olaf Hering and Takashi Iwai. # ### BEGIN INIT INFO # Provides: slmdm # Required-Start: $remote_fs # Required-Stop: $remote_fs # Default-Start: 2 3 5 # Default-Stop: # Description: Loading SmartLink HAMR5600 drivers ### END INIT INFO if [ -r /etc/rc.config ]; then . /etc/rc.config rc_warning="\033[m33m\033[1m" else rc_done="done" rc_warning="" rc_reset="" fi # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} function start() { # # insert all modules # echo -n -e "Loading SmartLink HAMR5600 modem drivers" /usr/lib/slmdm/load_slmdm echo $rc_done } function stop() { # # remove all modules # echo -n -e "Stopping SmartLink HAMR5600 modem drivers" /usr/lib/slmdm/unload_slmdm echo $rc_done } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart|reload) $0 stop $0 start ;; status) if [ `lsmod | egrep "slmdm.*[slamrmo slfax slv90]" |wc -l` == 1 ]; then echo -n "SmartLink HAMR5600 modem driver loaded." else echo -n "SmartLink HAMR5600 modem driver not loaded." fi echo ;; *) echo "Usage: slmdm {start|stop|restart|status}" exit 1 esac exit 0