Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 173811 - adsl.sh net script
Summary: adsl.sh net script
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High major (vote)
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
: 192460 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-08 22:38 UTC by Goran Mekić
Modified: 2018-03-11 18:00 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Script for ADSL interface config (adsl.sh,414 bytes, text/plain)
2007-04-08 22:41 UTC, Goran Mekić
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Goran Mekić 2007-04-08 22:38:34 UTC
Script for ADSL connection

Reproducible: Always




This is VERY bad example of scripting. I don't like the way ppp is called (not checking exit code, and I don't know how to check it). In order for "set redial" statement to work, ppp must be ran in ddial mode (only mode supporting this), and default behavior for ddir is to go to background. Anyone has any idea about this?
Comment 1 Goran Mekić 2007-04-08 22:41:23 UTC
Created attachment 115760 [details]
Script for ADSL interface config

Not really usable unless /etc/ppp/ppp.conf is configured right
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-04-09 08:09:25 UTC
Hmm, what's this about exactly? You should use the PPP baselayout module for ADSL connections, see [1] and /etc/conf.d/net.example

[1] http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=3#doc_chap4
Comment 3 Roy Marples (RETIRED) gentoo-dev 2007-04-09 09:35:16 UTC
(In reply to comment #2)
> Hmm, what's this about exactly? You should use the PPP baselayout module for
> ADSL connections, see [1] and /etc/conf.d/net.example

Sadly, Linux ppp is wildly different from BSD ppp, so that does not apply here. Currently, BSD doesn't have any net modules beyond basic interface, dhcp and wireless (iwconfig a like and wpa_supplicant).
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2007-04-09 09:38:57 UTC
(In reply to comment #3)
> Sadly, Linux ppp is wildly different from BSD ppp, so that does not apply here.

LOL, I need more coffee or beer in the morning... :P Completely missed that this is about *BSD, sorry. 
Comment 5 Roy Marples (RETIRED) gentoo-dev 2007-04-09 11:09:01 UTC
(In reply to comment #0)
> Script for ADSL connection
>
> This is VERY bad example of scripting. I don't like the way ppp is called (not
> checking exit code, and I don't know how to check it). In order for "set
> redial" statement to work, ppp must be ran in ddial mode (only mode supporting
> this), and default behavior for ddir is to go to background. Anyone has any
> idea about this?

Yes, that is not good.
First off the bat, why don't you attach the full output that is passed to grep.
I'm guessing it's the interface name that will be used. Also we should be trying to use one sed call instead of grep + awk. If you don't know sed, simply attach the full output can I can write the sed for it easily enough.
Lastly, you can store the exit code of pppd by storing $? in a variable immediately after launching like so

local tun=`ppp -ddial ${!provider} | grep tun | awk '{ print $3 }'`
local retval=$?
Comment 6 Javier Villavicencio (RETIRED) gentoo-dev 2008-07-02 22:07:33 UTC
*** Bug 192460 has been marked as a duplicate of this bug. ***
Comment 7 Patrice Clement gentoo-dev 2018-03-11 18:00:45 UTC
I'm not sure this bug is still relevant. Closing.