View Single Post
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#46
Originally Posted by fatalsaint View Post
@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 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
wow that is going to be a mare to type out!!!! :| :|
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -