After a long search for how to tether on MAC with HTC, I found this link: http://www.dinke.net/blog/en/2009/11/10/htc-hero-usb-tether-on-mac-os-x/ that actually worked.
so after tuntap, openvpn2, the android sdk, x-code, and all... I finally got HTC tethering on my mac. Now when I run it, and then decide to stop for any reason (close the terminal, ctrl Z, the computer goes to sleep...), I cannot re-establish a connection using the same script; as a matter of fact my normal wifi/ethernet connections stops working as well. I have to restart.
So me being a complete newbie to Mac, below is the script I run, and I'd appreciate the help of anyone on the infamous macrumors forum who would help me to properly terminate this script (or any other script for that matter) without having to restart my computer.
Thank you,
Tarek
--------------------
#!/bin/bash
#
# azilink for OS X
init() {
/users/tarekag/downloads/android-sdk-mac_86/tools/adb devices
/users/tarekag/downloads/android-sdk-mac_86/tools/adb forward tcp:41927 tcp:41927
sudo openvpn2 --script-security 3 system \
--dev tun \
--remote 127.0.0.1 41927 \
--proto tcp-client \
--ifconfig 192.168.56.2 192.168.56.1 \
--route 0.0.0.0 128.0.0.0 \
--route 128.0.0.0 128.0.0.0 \
--keepalive 10 30 \
--up "$0 up" \
--down "$0 down"
}
up() {
tun_dev=$1
ns=192.168.56.1
sudo scutil << EOF
open
d.init
get State:/Network/Interface/$tun_dev/IPv4
d.add InterfaceName $tun_dev
set State:/Network/Service/openvpn-$tun_dev/IPv4
d.init
d.add ServerAddresses * $ns
set State:/Network/Service/openvpn-$tun_dev/DNS
quit
EOF
}
down() {
tun_dev=$1
sudo scutil << EOF
open
remove State:/Network/Service/openvpn-$tun_dev/IPv4
remove State:/Network/Service/openvpn-$tun_dev/DNS
quit
EOF
}
case $1 in
up ) up $2 ;; # openvpn will pass tun/tap dev as $2
down) down $2 ;;
* ) init ;;
esac
so after tuntap, openvpn2, the android sdk, x-code, and all... I finally got HTC tethering on my mac. Now when I run it, and then decide to stop for any reason (close the terminal, ctrl Z, the computer goes to sleep...), I cannot re-establish a connection using the same script; as a matter of fact my normal wifi/ethernet connections stops working as well. I have to restart.
So me being a complete newbie to Mac, below is the script I run, and I'd appreciate the help of anyone on the infamous macrumors forum who would help me to properly terminate this script (or any other script for that matter) without having to restart my computer.
Thank you,
Tarek
--------------------
#!/bin/bash
#
# azilink for OS X
init() {
/users/tarekag/downloads/android-sdk-mac_86/tools/adb devices
/users/tarekag/downloads/android-sdk-mac_86/tools/adb forward tcp:41927 tcp:41927
sudo openvpn2 --script-security 3 system \
--dev tun \
--remote 127.0.0.1 41927 \
--proto tcp-client \
--ifconfig 192.168.56.2 192.168.56.1 \
--route 0.0.0.0 128.0.0.0 \
--route 128.0.0.0 128.0.0.0 \
--keepalive 10 30 \
--up "$0 up" \
--down "$0 down"
}
up() {
tun_dev=$1
ns=192.168.56.1
sudo scutil << EOF
open
d.init
get State:/Network/Interface/$tun_dev/IPv4
d.add InterfaceName $tun_dev
set State:/Network/Service/openvpn-$tun_dev/IPv4
d.init
d.add ServerAddresses * $ns
set State:/Network/Service/openvpn-$tun_dev/DNS
quit
EOF
}
down() {
tun_dev=$1
sudo scutil << EOF
open
remove State:/Network/Service/openvpn-$tun_dev/IPv4
remove State:/Network/Service/openvpn-$tun_dev/DNS
quit
EOF
}
case $1 in
up ) up $2 ;; # openvpn will pass tun/tap dev as $2
down) down $2 ;;
* ) init ;;
esac