View Single Post
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#44
@noobmonkey,
To create the file you can use:

Code:
touch /etc/maemo-dhcp.d/60_vpnc
Which will create the file empty. Editing the file, however, would be trickier. I suggest you use whatever default text app comes with the N900 (if it has one) and save his code into it and then save it to your documents. Then you can do something like:
Code:
mv /home/user/MyDocs/.documents/YourFile.txt /etc/maemo-dhcp.d/60_vpnc
And then continue on with his instructions.

If you happen to know VI(M), then you can just use it to create and edit the file in command line.

If you can copy and paste.. this (or something similar) should also work:
Code:
cat > /etc/maemo-dhcp.d/60_vpnc << EOF
 #!/bin/sh -e
 if route -n | grep -e "^0\.0\.0\.0" | grep -q tun0; then
     route -n | grep -e "^0\.0\.0\.0" | grep \$interface | awk '{print \$2}' > /tmp/vpnc_route
     ip=\`cat /var/run/vpnc/defaultroute | cut -f3 -d' '\`
     if [ -z \$ip ]; then
         killall vpnc
     else
         if route -n | grep -e "^0\.0\.0\.0" | grep -q \$ip; then
             route delete default \$interface
         fi
     fi
fi
EOF
(the above copy/paste is untested. Needs a tester to try it first.)
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!

Last edited by fatalsaint; 2010-01-14 at 22:20.
 

The Following User Says Thank You to fatalsaint For This Useful Post: