4 # written by Jan Kratochvil <short@ucw.cz>
7 # Linux running INSIDE VMWare (e.g. on Win32 machine)
8 # and internet connection through local ethernet card:
9 # You MUST enable masquerading (NAT) for your Communicator's IP address!
11 # iptables -t nat -A POSTROUTING --source 192.168.90.1 -j MASQUERADE
12 # (replace 192.168.90.1 by your $NOKIA9K setting below, if you change it)
13 # - problem investigation by courtesy of Hussain Akbar <Hussain@systemsltd.com>
16 # IP address for N9K, "192.168.90.1" if not provided (either here or from
17 # some ~/.profile etc.)
20 # Nameserver for N9K, taken from /etc/resolv.conf if not provided
23 # Serial port with attached N9K, default is /dev/ttyS1 (AKA COM2:)
26 # Nokia baudrate, usually 19200 or 38400, default is 19200
29 # No user-servicable parts below!
31 pid="/var/run/ppp9k.pid"
33 if kill -0 `head -n 1 "$pid"` 2>/dev/null;then
34 echo "Killing previous ppp9k on PID(s):" `cat "$pid"`
39 echo "Removing state lock of PID(s):" `cat "$pid"`
44 IP="${NOKIA9K:-192.168.90.1}"
45 NS="`grep '^nameserver' /etc/resolv.conf|head -n 1|cut -f 2 -d ' '`"
47 if [ "$NS" = localhost -o "${NS#127.}" != "$NS" ];then NS="`hostname -f`";fi
49 if [ "${PORT#*/}" = "$PORT" ];then PORT="/dev/$PORT";fi
50 NOKIABAUD="${NOKIABAUD:-19200}"
52 # Some rules for the chat script:
53 # 9000i starts with: ATZ, AT&F (the need for TIMEOUT 2, "-OK^M^J-AT&F")
54 # 9110 starts with: AT&F
55 # user can have global custom initialization string (need for one "OK^M^J")
56 # user can have connection custom initialization string (need for one "OK^M^J")
59 while [ '!' -f "$pid" ];do sleep 1;done
62 pppd "$PORT" "$NOKIABAUD" modem lock -crtscts xonxoff :$IP asyncmap 0 ms-dns "$NS" \
67 "&F-OK^M^J-AT&F" "OK^M^JOK^M^JOK^M^J" \
71 -ccp nodefaultroute proxyarp lcp-echo-interval 30 lcp-echo-failure 2 lcp-max-configure 30 -detach \
73 echo -e "$me\n$!" >"$pid"
77 done) </dev/null &>/dev/null &
81 echo "Starting up: PID=$he, port=$PORT, baud=$NOKIABAUD, remoteIP=$IP, nameserver=$NS"