summarylogtreecommitdiffstats
path: root/lte.sh
blob: 3d9208fcedd9249634b3f124449dba72ec8e8419 (plain)
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
33
34
35
36
37
38
39
40
#!/bin/bash
# use: sudo lte up

if [[ "$1" = "" ]]; then
  echo "nothing to do, try with up or down"
  exit 1
fi

CONF_FILE=/etc/xmm7360

# check if xmm7360.ini is available or exit
if [ -f "$CONF_FILE" ]; then
  source $CONF_FILE
else
  echo "no configuration file found"
  exit 1
fi

if [[ $EUID -ne 0 ]]; then
  echo "This script must be run as root!"
  exit 1
fi

echo "lte.sh: manage xmm7360-pci"
echo "APN: $apn"
echo ""

# down param
if [[ "$1" = "down" ]]; then
  echo "taking wwan0 down!" 
  ip link set wwan0 down
  exit
fi

if [[ "$1" = "up" ]]; then
  echo "bringing wwan0 up!" 

  python3 /usr/lib/xmm7360-pci-spat/rpc/open_xdatachannel.py -c $CONF_FILE
  ip link set wwan0 up
fi