Acer 3400LMI User Manual
Size:
756.04 Kb
Download

F8­x86_64 on the Acer Ferrari 3400LMi

Appendix D /etc/init.d/slmodemd

#!/bin/sh

#

#Available at http://ferrari.databa.se/3400/f8/slmodemd­sysv­init.sh

#Use slmodemd­sysv­init.sh install to install it.

#

# slmodemd: Starts the SmartLink Modem Daemon

#

#chkconfig: 345 90 10

#description: This is the user space part of the SmartLink Modem driver

#processname: slmodemd

# config: /etc/sysconfig/slmodemd

# Source function library.

. /etc/init.d/functions

PROG=slmodemd

RETVAL=0

#Default configuration SLMODEMD_DEVICE= SLMODEMD_OPTS= SLMODEMD_COUNTRY=SWEDEN USE_ALSA="yes"

#Source configuration CONFIG=/etc/sysconfig/${PROG} if [ ­f $CONFIG ]; then

. $CONFIG

#override default group and permissions if defined in $CONFIG;

#other valid options also can be put into SLMODEMD_OPTS variable

["$GROUP" ] \

&&SLMODEMD_OPTS="$SLMODEMD_OPTS ­­group=$GROUP"

["$PERMS" ] \

&&SLMODEMD_OPTS="$SLMODEMD_OPTS ­­perm=$PERMS"

fi

# Do not try to start on a kernel which does not support it if [ $USE_ALSA != "yes" ]; then

grep ­q 'slamr\.o' /lib/modules/`uname ­r`/modules.dep || exit 0

fi

if [ $USE_ALSA = "yes" ]; then SLMODEMD_OPTS="$SLMODEMD_OPTS ­­alsa"

else

SLMODEMD_OPTS="$SLMODEMD_OPTS $SLMODEMD_DEVICE"

fi

start() {

54

F8­x86_64 on the Acer Ferrari 3400LMi

echo ­n "Starting SmartLink Modem driver: "

${PROG} ­­country=$SLMODEMD_COUNTRY $SLMODEMD_OPTS 2>&1 \ | logger ­t ${PROG} &

PID=`pidof ${PROG}` RETVAL=$?

[$RETVAL ­eq 0 ] \

&&success $"${PROG} startup" \

|| failure $"${PROG} startup"

echo

[$RETVAL ­eq 0 ] \

&&touch /var/lock/subsys/${PROG} return $RETVAL

}

stop() {

echo ­n "Shutting down SmartLink Modem driver: " killproc ${PROG}

RETVAL=$?

[ $RETVAL ­eq 0 ] && rm ­f /var/lock/subsys/${PROG} echo

return $RETVAL

}

# See how we were called. case "$1" in

start) start

;;

stop) stop

;;

status)

status ${PROG} RETVAL=$?

;;

restart|reload) stop

start RETVAL=$?

;;

condrestart)

if [ ­f /var/lock/subsys/${PROG} ]; then stop

start RETVAL=$?

fi

;;

install)

install ­t ­m 755 $0 /etc/init.d/${PROG} &> /dev/null chkconfig ­­add ${PROG}

;;

*)

55

F8­x86_64 on the Acer Ferrari 3400LMi

echo "Usage: ${PROG} {start|stop|status|restart|condrestart| install}"

exit 1

esac

exit $RETVAL

56