Re: integer expression error..?

From: rakesh sharma (sharma__r_at_hotmail.com)
Date: 10/21/03


Date: 20 Oct 2003 16:18:18 -0700


"see sig" <post@togroup.net> wrote in message news:<pan.2003.10.20.18.29.50.418568@togroup.net>...
> I've written a script to check my ppp status on a machine who's pppd has a
> habit of locking up...
> Testing it i am getting an error at end dns check - any help with this
> error would be greatly appreciated
>
> this is the error:
>
> ./pppd_reset.sh: [: 216.191.73.107: integer expression expected
>
> here's the script
>
> #!/bin/bash
> #
>
> killall pppd
> if [ $? -eq 0 ]; then
> echo "pppd has been killed"
> else
> echo "pppd has not been killed."
> fi
> echo "starting pppd"
> /usr/sbin/pppd :207.69.188.185
> ping -c 1 63.211.66.107
> sleep 90
> dnscheck=`dig www.microsoft.com |grep 107| awk '{print $5}'`
> if [ "$dnscheck" -eq "63\.211\.66\.107" ]; then
> echo "dnscheck is ok"
> exit
> else
> echo "dns check failed -pppd is down"
> fi

use the 'case' statement instead.

dnscheck="`dig www.microsoft.com |grep 107| awk '{print $5}'`"

case $dnscheck in
  63.211.66.107) echo "dnscheck is ok"; exit 0;;
  *) echo "dns check failed -pppd is down";;
esac



Relevant Pages

  • Re: dialup solution (as seconary connection / iptables )
    ... ip-down is launched by pppd only after the PPP link no longer available ... first with MINICOM or is PAP and script not mutualy exclusive? ... do have to "make the connection first with MINICOM." ... If you use the Linux box and route the news IP address to it on each ...
    (comp.os.linux.networking)
  • Re: pppd pty equivilent in FBSD
    ... I let pppd manage retries & setting routes. ... >I wouldn't personally recommend vpn over ssh for anyone either, ... I'm the sole bsd user at my company, and the ppp over ssh ... >Actual bash script I call: ...
    (freebsd-net)
  • Re: Modem--pppd Died Unexpectedly
    ... PAP authentication is rejected by pppd above. ... If you want to try a script, the ppp-secrets.gz script found at my ... To get chat log messages the S in the chat -vsS parameter must be removed. ...
    (comp.os.linux.networking)
  • Re: Emulating a modem with expect
    ... > (basically allows GUI connections via telnet if X is not allowed). ... > script works fine on Linux machines since it makes a call to pppd on both ... > Basically pppd on Linux creates a ppp0 interace automatically, ... > Once chat finishes the phyiscal connection of dialing, ...
    (comp.lang.tcl)
  • Re: using wvdial/pppd as normal user
    ... Just make pppd suid root, and make pppd and chat rx for everyone as ... and then make an icon on the desktop to run that script when clicked on. ... ]automate that without requiring any user interaction). ... ]> are set by devfs. ...
    (alt.os.linux)