annotate debian/static/etc/network/if-pre-up.d/quicktun @ 32:51c6d2fc712f V2.1.8

Fixes contributed by Daniel Dickinson <daniel@cshore.neomailbox.net>
author Ivo Smits <Ivo@UCIS.nl>
date Wed, 12 Oct 2011 01:34:46 +0200
parents 3400045a57b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
65c01f57bdce Initial commit
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
1 #!/bin/sh
65c01f57bdce Initial commit
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
2 test -n "${IF_QT_REMOTE_ADDRESS}" || exit 0
19
3400045a57b8 Version 2.1.6, changed sourcecode archive generation, use NaCl version 20110221, do not duplicate NaCl sourcecode, support iproute2 for persistent tunnel creation on Debian, support running as root on Debian, removed autogenerated header files
Ivo Smits <Ivo@UCIS.nl>
parents: 0
diff changeset
3 test -z "${IF_QT_NO_PRECREATE}" || exit 0
32
51c6d2fc712f Fixes contributed by Daniel Dickinson <daniel@cshore.neomailbox.net>
Ivo Smits <Ivo@UCIS.nl>
parents: 19
diff changeset
4 if [ -n "${IF_QT_TUN_MODE}" ] && [ "${IF_QT_TUN_MODE}" = "1" ]; then
19
3400045a57b8 Version 2.1.6, changed sourcecode archive generation, use NaCl version 20110221, do not duplicate NaCl sourcecode, support iproute2 for persistent tunnel creation on Debian, support running as root on Debian, removed autogenerated header files
Ivo Smits <Ivo@UCIS.nl>
parents: 0
diff changeset
5 DEVTYPE="tun"
3400045a57b8 Version 2.1.6, changed sourcecode archive generation, use NaCl version 20110221, do not duplicate NaCl sourcecode, support iproute2 for persistent tunnel creation on Debian, support running as root on Debian, removed autogenerated header files
Ivo Smits <Ivo@UCIS.nl>
parents: 0
diff changeset
6 else
3400045a57b8 Version 2.1.6, changed sourcecode archive generation, use NaCl version 20110221, do not duplicate NaCl sourcecode, support iproute2 for persistent tunnel creation on Debian, support running as root on Debian, removed autogenerated header files
Ivo Smits <Ivo@UCIS.nl>
parents: 0
diff changeset
7 DEVTYPE="tap"
3400045a57b8 Version 2.1.6, changed sourcecode archive generation, use NaCl version 20110221, do not duplicate NaCl sourcecode, support iproute2 for persistent tunnel creation on Debian, support running as root on Debian, removed autogenerated header files
Ivo Smits <Ivo@UCIS.nl>
parents: 0
diff changeset
8 fi
3400045a57b8 Version 2.1.6, changed sourcecode archive generation, use NaCl version 20110221, do not duplicate NaCl sourcecode, support iproute2 for persistent tunnel creation on Debian, support running as root on Debian, removed autogenerated header files
Ivo Smits <Ivo@UCIS.nl>
parents: 0
diff changeset
9 if [ -x /usr/sbin/openvpn ]; then
3400045a57b8 Version 2.1.6, changed sourcecode archive generation, use NaCl version 20110221, do not duplicate NaCl sourcecode, support iproute2 for persistent tunnel creation on Debian, support running as root on Debian, removed autogenerated header files
Ivo Smits <Ivo@UCIS.nl>
parents: 0
diff changeset
10 /usr/sbin/openvpn --mktun --dev "${IFACE}" --dev-type "${DEVTYPE}" --user quicktun
32
51c6d2fc712f Fixes contributed by Daniel Dickinson <daniel@cshore.neomailbox.net>
Ivo Smits <Ivo@UCIS.nl>
parents: 19
diff changeset
11 elif [ -x /sbin/ip ] && /sbin/ip tuntap 2>&1 >/dev/null; then
19
3400045a57b8 Version 2.1.6, changed sourcecode archive generation, use NaCl version 20110221, do not duplicate NaCl sourcecode, support iproute2 for persistent tunnel creation on Debian, support running as root on Debian, removed autogenerated header files
Ivo Smits <Ivo@UCIS.nl>
parents: 0
diff changeset
12 /sbin/ip tuntap add dev "${IFACE}" mode "${DEVTYPE}" user quicktun
32
51c6d2fc712f Fixes contributed by Daniel Dickinson <daniel@cshore.neomailbox.net>
Ivo Smits <Ivo@UCIS.nl>
parents: 19
diff changeset
13 elif [ -x /usr/sbin/tunctl ]; then
51c6d2fc712f Fixes contributed by Daniel Dickinson <daniel@cshore.neomailbox.net>
Ivo Smits <Ivo@UCIS.nl>
parents: 19
diff changeset
14 /usr/sbin/tunctl -u quicktun -t "${IFACE}"
19
3400045a57b8 Version 2.1.6, changed sourcecode archive generation, use NaCl version 20110221, do not duplicate NaCl sourcecode, support iproute2 for persistent tunnel creation on Debian, support running as root on Debian, removed autogenerated header files
Ivo Smits <Ivo@UCIS.nl>
parents: 0
diff changeset
15 else
32
51c6d2fc712f Fixes contributed by Daniel Dickinson <daniel@cshore.neomailbox.net>
Ivo Smits <Ivo@UCIS.nl>
parents: 19
diff changeset
16 echo "Unable to pre-create tun/tap interface. Run QuickTun as root by setting QT_NO_PRECREATE."
19
3400045a57b8 Version 2.1.6, changed sourcecode archive generation, use NaCl version 20110221, do not duplicate NaCl sourcecode, support iproute2 for persistent tunnel creation on Debian, support running as root on Debian, removed autogenerated header files
Ivo Smits <Ivo@UCIS.nl>
parents: 0
diff changeset
17 fi