|
|
fi | fi |
} | } |
| |
function loadsalsa { |
loadsalsa { |
ebegin "Starting slmodemd for ${DEV}" | ebegin "Starting slmodemd for ${DEV}" |
start-stop-daemon --start --background --nicelevel=${NICE} --make-pidfile \ | start-stop-daemon --start --background --nicelevel=${NICE} --make-pidfile \ |
--pidfile /var/run/slmodemd.pid --startas /usr/sbin/slmodemd \ | --pidfile /var/run/slmodemd.pid --startas /usr/sbin/slmodemd \ |
|
|
return ${?} | return ${?} |
} | } |
| |
function loadsmodule { |
loadsmodule { |
modprobe ${MODULE} | modprobe ${MODULE} |
| |
if [ "$?" -gt 0 ]; then | if [ "$?" -gt 0 ]; then |
|
|
# either if we use alsa or not, the only thing we need is | # either if we use alsa or not, the only thing we need is |
# ttySL0, which is created by slmodemd when started (points to a pts) | # ttySL0, which is created by slmodemd when started (points to a pts) |
| |
if [ "${MODULE}" == "alsa" ]; then |
if [ "${MODULE}" = "alsa" ]; then |
loadsalsa | loadsalsa |
else | else |
loadsmodule | loadsmodule |
|
|
[ -e /var/run/slmodemd.pid ] && rm /var/run/slmodemd.pid | [ -e /var/run/slmodemd.pid ] && rm /var/run/slmodemd.pid |
unlink ${LN_DEV} 2> /dev/null | unlink ${LN_DEV} 2> /dev/null |
eend ${result} | eend ${result} |
if [ ! "${MODULE}" == "alsa" ]; then |
if [ ! "${MODULE}" = "alsa" ]; then |
ebegin "Waiting for ${MODULE} modem driver unload" |
ebegin "Waiting for ${MODULE} modem driver unload..." |
if [ "$RC_NOCOLOR" != "yes" ]; then |
for a in `seq 0 2`; |
echo -e "\e[A\e[44G " |
|
echo -ne "\e[A\e[44G" |
|
fi |
|
for ((a=0,result=1; result==1 && a <= 5 ; a++)) |
|
do | do |
sleep 0.25 |
sleep 1 |
echo -n "." | echo -n "." |
modprobe -r slamr 2> /dev/null && result=0 | modprobe -r slamr 2> /dev/null && result=0 |
done | done |