From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Injected-Via-Gmane: http://gmane.org/ To: community@altlinux.ru From: Arioch Date: Sat, 30 Jul 2005 17:27:52 +0400 Message-ID: <42EB8058.6090300@nm.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070407090902000706090502" X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 212.26.238.29 User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050512) X-Accept-Language: en-us, en Sender: news Cc: week@altlinux.ru Subject: [Comm] =?koi8-r?b?zMnT1MHRIC9ldGMvaW5pdC5kL3NsbW9kZW1k?= X-BeenThere: community@altlinux.ru X-Mailman-Version: 2.1.5 Precedence: list Reply-To: community@altlinux.ru List-Id: Mailing list for ALT Linux users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2005 15:11:06 -0000 Archived-At: List-Archive: List-Post: This is a multi-part message in MIME format. --------------070407090902000706090502 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: quoted-printable slmodemd - =DC=D4=CF =C4=C5=CD=CF=CE =CD=CE=CF=C7=C9=C8 win-=CD=CF=C4=C5=CD= =CF=D7, =CE=C1=D0=D2=C9=CD=C5=D2 =CF=C4=CE=CF=C7=CF, =D7=D3=D4=D2=CF=C5=CE= =CE=CF=C7=CF =D7 =CD=CF=CA =CE=CF=D5=D4 (MaxSelect.ru M620). =F3=C9=D6=D5 =D0=D2=C1=CB=D4=C9=DE=C5=D3=CB=C9 =C2=C5=DA =C9=CE=C5=D4=C1 = - =D0=CF=D4=CF=CD=D5 =D7=D3=C5 =D0=C9=D3=D8=CD=C1 =C7=CF=D4=CF=D7=CC=C0 =D7= =CF=C6=CC=C1=CA=CE=C5. =F0=CF=D4=CF=CD=D5 =D6=C5 =F3=C9=DA=C9=C6 =D5 =CD=C5=CE=D1 =D0=D2=C9=CD=C5= =D2=CE=CF =CD=C5=D3=D1=DE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D=C5=D4=D8 =D0=D2=C1=D7=C1 =CE=C1 /dev/modem ? PPPS: =C4=C1=CA =C2=CF=C7 =CD=CE=C5 =DC=D4=CF=D4 =CD=CF=C4=C5=CD =CE=C1=D3= =D4=D2=CF=C9=D4=D8, =CB=CF=C7=C4=C1 =D7 HOWTO =CF=D0=C9=D3=C1=CE =CE=C5=D3=D5=DD=C5=D3=D4=D7=D5=C0=DD=C9=CA =D5 =CD=C5=CE=D1 usernetctl =DA= =C1=D4=CF =CE=C1=D0=D2=CF=DE=D8 =CF=D4=D3=D5=D4=D3=D4=D7=D5=C5=D4 etcnet = :( =E9 =C4=C1 =D3=D5=CD=C5=C5=D4 =CD=CF=C4=C5=CD =C4=CF=DA=D7o=CE=C9=D4=D8=D3= =D1 =C4=CF =CF=C4=CE=CF=C7=CF =CE=CF=CD=C5=D2=C1 (=C5=D3=CC=C9 =C4=C1 - =DA= =CE=C1=DE=C9=D4 =D3=D4=C1=D2=CF=CB=D2=C9=D7=D9=C5 =C4=D2=CF=D7=C1 =D7 =D7=C9=CE=C4=C5. =E5= =D3=CC=C9 =CE=C5=D4 - =DA=CE=C1=DE=C9=D4 =D7=CF=CF=C2=DD=C5 =CE=C5=D4 :( = ) --------------070407090902000706090502 Content-Type: text/plain; name="slmodemd" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="slmodemd" #!/bin/sh # $Id: template,v 1.3 2003/05/21 17:47:00 ldv Exp $ ### the_Arioch@nm.ru - i wanna /dev/modem symlink be automagic # # slmodemd Smartlink softmodem driver daemon # # chkconfig: 345 90 10 # description: slmodemd is SmartLink softmodem drivers daemon # # # processname: slmodemd # Do not load RH compatibility interface. WITHOUT_RC_COMPAT=1 # Source function library. . /etc/init.d/functions PIDFILE=/var/run/slmodemd.pid LOCKFILE=/var/lock/subsys/slmodemd RETVAL=0 #Arioch - since slmodem now features SysFS interface - lets engage it SYSFS_DRIVERS=/sys/class/{slusb,slamr} # i do not know what to do with ALSA modems - and how do they show up; # also i do not have usb modem and hope it will just follow slamr pattern. # I assume if someone have built-in modem (slamr) and at the same time external # one (slusb) - he prefers USB one. #Now, what env-vars respect ls ? can i unexpectedly get verbose output without -l argument? #Something like LS_COLORS or like DirCmd in DOS/Windows, i need to clear before invoking ls ? SYSFS_DEVICES= #in case it was borrowed from parent process [[ -d /sys ]] && SYSFS_DEVICES=`for fold in /sys/class/{slusb,slamr}; do ls $fold ; done 2>/dev/null` #i guess, for 2.4 kernels one could have one more list instead of sysfs #parsing dmesg, or returned by slmodemd --SomeQueryOption, or from /etc/SomeWhere ## End of Arioch (yet) start() { action "Starting slmodem daemon: " start-stop-daemon --quiet --start -b -m --pidfile $PIDFILE --exec /usr/sbin/slmodemd -- --country=RUSSIA RETVAL=$? # Arioch: # 1st existing slmodem device i'd like to see symlinked as /dev/modem - if /dev/modem is not occupied already # But let returning value stay the daemon's return code if [ $RETVAL -eq 0 ]; then if [[ ! -e /dev/modem ]]; then for smth in "$SYSFS_DEVICES"; do [[ -e /dev/$smth ]] && ( ln -s /dev/$smth /dev/modem ; break ) done; fi fi # A rake, i placed here: imagine someday DEVFS or UDEV would move slamr0 to, say, # /dev/modems/slamr0 or to any other subfolder - "[[ -e /dev/$smth ]]" would fail. # To avoid stepping upon the rake someday, we maybe can search throughout /dev. # /sys/class/(DRIVER)/(DEVICE)/dev contain major and minor and this can be # used to find driver file wherever under /dev - but i don't know any easy way. # End of Arioch (yet) return $RETVAL } stop() { action "Stopping slmodem daemon: " start-stop-daemon --stop --quiet --pidfile $PIDFILE slmodemd RETVAL=$? # Arioch: let's wipe away /dev/modem, if it is our own link if [ $RETVAL -eq 0 ]; then local TARGET # i'm afraid local is command, thus can affect value of $? TARGET=`readlink -e /dev/modem` && [[ -c $TARGET ]] && TARGET=`basename $TARGET` # see rooks in start(). #Now, how should i test is word is contained in list ? [ $? -eq 0 ] && ( echo $SYSFS_DEVICES | grep -G "\<$TARGET\>" >/dev/null 2>/dev/null ) && rm -f /dev/modem #Neither slmodemd nor start-stop-daemon don't care about PID :-( rm -f $PIDFILE fi # End of Arioch (yet) return $RETVAL } restart() { stop sleep 1 start } reload() { msg_reloading slmodemd start-stop-daemon --stop --pidfile $PIDFILE -s HUP -- slmodemd RETVAL=$? return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; reload) reload ;; restart) restart ;; condstop) if [ -e "$LOCKFILE" ]; then stop fi ;; condrestart) if [ -e "$LOCKFILE" ]; then restart fi ;; condreload) if [ -e "$LOCKFILE" ]; then reload fi ;; status) status --pidfile "$PIDFILE" --expect-user root -- slmodemd RETVAL=$? # Arioch (next line, list of devices): [[ -n "SYSFS_DEVICES" ]] && echo " Known devices: $SYSFS_DEVICES" # End of Arioch. "finishing, closing and going home" ;; *) msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}" RETVAL=1 esac exit $RETVAL --------------070407090902000706090502--