summaryrefslogtreecommitdiff
path: root/roles/ws/minet/templates/connections/a1Mobile.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/ws/minet/templates/connections/a1Mobile.j2')
-rwxr-xr-xroles/ws/minet/templates/connections/a1Mobile.j231
1 files changed, 31 insertions, 0 deletions
diff --git a/roles/ws/minet/templates/connections/a1Mobile.j2 b/roles/ws/minet/templates/connections/a1Mobile.j2
new file mode 100755
index 00000000..205ca791
--- /dev/null
+++ b/roles/ws/minet/templates/connections/a1Mobile.j2
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+SHORT_NAME="a1Mobile"
+DESC_NAME="A1 Mobiles Schmalband"
+USB_DEV="/dev/mobile"
+RFCOMM_DEV="/dev/rfcomm1"
+BT_ADDR="38:EC:E4:86:8F:D3"
+RFCOMM_CHANNEL=3
+
+case "$1" in
+ start|"")
+ echo "Connecting with $DESC_NAME"
+ if [ -e "$USB_DEV" ]; then
+ DEV=$USB_DEV
+ else
+ /usr/bin/rfcomm -A -E -S bind $RFCOMM_DEV $BT_ADDR $RFCOMM_CHANNEL
+ DEV=$RFCOMM_DEV
+ fi
+ /usr/bin/pon a1.net $DEV
+ ;;
+ stop)
+ echo "Disconnecting from $DESC_NAME"
+ /usr/bin/poff a1.net
+ if [ ! -e "$USB_DEV" ]; then
+ /usr/bin/rfcomm release $RFCOMM_DEV
+ fi
+ ;;
+ *)
+ exit 1
+ ;;
+esac