Well... I had to solve this in order to file this bug :) /lib/rc/net/pppd.sh: I guess: if [ "${chat}" ] ; then local IFS="$__IFS" + set -- ${chat} opts="${opts} connect $(printf "\\'%s\\'" "${chatopts} $(printf "\\'\\\\'\\'%s\\'\\\'' " "$@")")" unset IFS fi Next, the net.exmaple is out of date, took me some time to figure out how to handle the chat script. At the end I came up with the following: e() { local s while [ -n "$1" ]; do [ -z "${s}" ] && s="$1" || s="${s} $1" shift done echo "${s}" } chat_ppp0="\ $(e 'ABORT' 'BUSY') $(e 'ABORT' 'ERROR') $(e 'ABORT' 'NO ANSWER') $(e 'ABORT' 'NO CARRIER') $(e 'ABORT' 'NO CARRIER') $(e 'ABORT' 'NO DIALTONE') $(e 'ABORT' 'Invalid Login') $(e 'ABORT' 'Invalid incorrect') $(e 'TIMEOUT' '5') $(e "''" 'AT&F') $(e 'OK' 'ATV1E0&D2&S0&C1S0=0') $(e 'OK' 'AT+CGDCONT=1,"IP","internet"') $(e 'OK' 'ATDT\T') $(e 'TIMEOUT' '60') $(e 'CONNECT' "''") $(e 'TIMEOUT' '5') $(e '~--' '')" I think this "e" will be handy if provided by baselayout to users... Without it this chat script looks a mess. Anyway, please not that baselayout does not take empty lines as empty array elements, I had to put "''" in order to do so, but I don't think this will work with any configuration. Please consider handling empty lines as elements. Thanks!
Created attachment 134905 [details, diff] ppp.patch See how this works for you.
You say that each line is an array element, but then you add single quote in order to separate between subelements... I liked better the old single-quote-per-element-no-new-line notation. There is same issue with many other arguments such as brctl. This patch does not work. I had to revert. Did not find out how to solve this, but all the chat script is passed to chat as a single argument, while it expect every atom to be on its own.
Created attachment 134924 [details] pppd.sh This full script has some debugging enabled. Please attach the resulting output. From my understanding the chat program works like so chat -a -b -c OP1A OP1B OP2A OP2B OP3A OP3B And that is what it should eval down to.
Created attachment 134925 [details] ppp net config What I used to test
* Caching service dependencies ... [ ok ] * Bringing up interface ppp0 unit 0 linkname ppp0 noauth defaultroute usepeerdns lock defaultmetric 4006 maxfail 0 persist connect '/usr/sbin/chat -e -E -v -T '"'"'*99#'"'"' '"'"'ABORT BUSY ABORT ERROR ABORT '"'"'"'"'"'"'"'"'NO ANSWER'"'"'"'"'"'"'"'"' ABORT '"'"'"'"'"'"'"'"'NO CARRIER'"'"'"'"'"'"'"'"' ABORT '"'"'"'"'"'"'"'"'NO DIALTONE'"'"'"'"'"'"'"'"' ABORT '"'"'"'"'"'"'"'"'Invalid Login'"'"'"'"'"'"'"'"' ABORT '"'"'"'"'"'"'"'"'Login incorrect'"'"'"'"'"'"'"'"' TIMEOUT 5 '"'"'"'"'"'"'"'"''"'"'"'"'"'"'"'"' '"'"'"'"'"'"'"'"'AT&F'"'"'"'"'"'"'"'"' OK '"'"'"'"'"'"'"'"'ATV1E0&D2&S0&C1S0=0'"'"'"'"'"'"'"'"' OK '"'"'"'"'"'"'"'"'AT+CGDCONT=1,"IP","internet"'"'"'"'"'"'"'"'"' OK AT OK ATDT\T TIMEOUT 60 CONNECT '"'"'"'"'"'"'"'"''"'"'"'"'"'"'"'"' TIMEOUT 5 '"'"'"'"'"'"'"'"'~--'"'"'"'"'"'"'"'"' '"'"'"'"'"'"'"'"''"'"'"'"'"'"'"'"''"'"'' /usr/sbin/chat -e -E -v -T '*99#' 'ABORT BUSY ABORT ERROR ABORT '"'"'NO ANSWER'"'"' ABORT '"'"'NO CARRIER'"'"' ABORT '"'"'NO DIALTONE'"'"' ABORT '"'"'Invalid Login'"'"' ABORT '"'"'Login incorrect'"'"' TIMEOUT 5 '"'"''"'"' '"'"'AT&F'"'"' OK '"'"'ATV1E0&D2&S0&C1S0=0'"'"' OK '"'"'AT+CGDCONT=1,"IP","internet"'"'"' OK AT OK ATDT\T TIMEOUT 60 CONNECT '"'"''"'"' TIMEOUT 5 '"'"'~--'"'"' '"'"''"'"'' /usr/sbin/chat -e -E -v -T *99# ABORT BUSY ABORT ERROR ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT 'NO DIALTONE' ABORT 'Invalid Login' ABORT 'Login incorrect' TIMEOUT 5 '' 'AT&F' OK 'ATV1E0&D2&S0&C1S0=0' OK 'AT+CGDCONT=1,"IP","internet"' OK AT OK ATDT\T TIMEOUT 60 CONNECT '' TIMEOUT 5 '~--' '' -T * ERROR: net.ppp0 failed to start
Created attachment 134946 [details] net This is what I use.
Created attachment 134974 [details, diff] pppd.patch See if this fixes it for you.
Nope... Looks like it still put all the chat script as one argument. --- Nov 2 00:45:47 alon1 pppd[32764]: pppd 2.4.4 started by root, uid 0 Nov 2 00:45:47 alon1 /etc/init.d/net.ppp0[32371]: WARNING: net.ppp0 has started, but is inactive Nov 2 00:45:47 alon1 hcid[29786]: link_key_request (sba=00:20:E0:7E:26:90, dba=00:12:37:E9:20:2D) Nov 2 00:45:49 alon1 chat[304]: expect (ABORT BUSY ABORT ERROR ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT 'NO DIALTONE' ABORT 'Invalid Login' ABORT 'Login incorrect' TIMEOUT 5 '' 'AT&F' OK 'ATV1E0&D2&S0&C1S0=0' OK 'AT+CGDCONT=1,"IP","internet"' OK AT OK ATDT\T TIMEOUT 60 CONNECT '' TIMEOUT 5 '~)
Created attachment 134989 [details, diff] pppd.patch Hmmm, I thought it was supposed to work like that? OK, this new patch sends them as individual arguments. See if it fixes it for you.
Better. Two modifications: -opts="${opts} connect '$(echo ${chatprog} $@ | sed -e "s:':'\\\\'':g")'" +opts="${opts} connect '$(echo ${chatprog} "${chatopts}" $@ | sed -e "s:':'\\\\'':g")'" -#OK ATDT\T +#OK 'ATDT\T' Thanks!
Created attachment 134993 [details, diff] pppd.patch OK, this patch sould be golden now.
Confirmed. Thanks!
Applied to our svn repo. I'll probably release rc7 this weekend when I can look into your ifplugd stuff.