hso.if-down 287 B

123456789101112
  1. #!/bin/sh
  2. [ "$IFACE" == "hso0" ] || exit 0
  3. [ -f /tmp/hso-connect ] || exit 0
  4. PID=$(cat /tmp/hso-connect)
  5. ps | grep "$PID" | grep -q hso-connect.sh && kill "$PID"
  6. comgt -s -d /dev/ttyHS0 /etc/comgt/hsodisconnect.comgt
  7. rm -f /tmp/hso-connect
  8. ip address flush hso0
  9. ip link set hso0 down