diff options
author | Christian Pointner <equinox@spreadspace.org> | 2020-12-29 01:27:26 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2020-12-29 01:27:26 +0100 |
commit | 45b2aa221aa2a5a85c9e221b5e03256bd0823999 (patch) | |
tree | 80bc14c3e40e7fae04e6881462a28c9e3485ca57 /roles/ws/minet/templates/connections/a1Mobile.j2 | |
parent | ch-equinox-t450s: disable netplan (diff) |
ws/minet: add more connection scripts
Diffstat (limited to 'roles/ws/minet/templates/connections/a1Mobile.j2')
-rwxr-xr-x | roles/ws/minet/templates/connections/a1Mobile.j2 | 31 |
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 |