summaryrefslogtreecommitdiff
path: root/roles/ws/minet/templates/connections/elevateDomWire.j2
blob: 4f579df13907d7991e9263c68b5446fc6f4fae55 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

SHORT_NAME="elevatedomwire"
DESC_NAME="elevate DOM WIRE"
INTERFACE="{{ ws_minet_wired_interface_name }}"
MODULE_NAME="{{ ws_minet_wired_interface_module }}"

. /usr/local/lib/minet/minet_helpers.sh

case "$1" in
  start|"")
    echo "Connecting with $DESC_NAME"
    activate_interface $INTERFACE $MODULE_NAME
    ifconfig $INTERFACE 91.143.110.174 netmask 255.255.255.240
    route add default gw 91.143.110.161
    ip addr add dev $INTERFACE 192.168.84.23/24
    echo "search spreadspace.org" > /tmp/$SHORT_NAME.resolv
    echo "domain spreadspace.org" >> /tmp/$SHORT_NAME.resolv
    echo "nameserver 217.29.144.65" >> /tmp/$SHORT_NAME.resolv
    echo "nameserver 217.29.144.66" >> /tmp/$SHORT_NAME.resolv
    resolvconf -a $INTERFACE < /tmp/$SHORT_NAME.resolv
    rm /tmp/$SHORT_NAME.resolv
    ;;
  stop)
    echo "Disconnecting from $DESC_NAME"
    resolvconf -d $INTERFACE
    deactivate_interface $INTERFACE $MODULE_NAME
    ;;
  *)
    exit 1
    ;;
esac