Sha256: a74e1fe5c35ec5eb47223e17eaaf9bf0ff9431633253d6dc7d4be5a9bc68a369

Contents?: true

Size: 511 Bytes

Versions: 1

Compression:

Stored size: 511 Bytes

Contents

#!/usr/bin/env bash

set -e

default_dev=$(ip r | grep '^default via' | cut -d ' ' -f 5)

if [ "$default_dev" == '' ]; then
  # Disconnected
  echo "State: Disconnected"
  systemctl stop snapsync-is-connection-unmetered.service
  exit 0
fi

if [ "$(nmcli -g general.metered dev show "$default_dev" | cut -d ' ' -f 1)" == 'no' ]; then
  echo "State: Unmetered"
  systemctl start snapsync-is-connection-unmetered.service
else
  echo "State: Metered"
  systemctl stop snapsync-is-connection-unmetered.service
fi


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
snapsync-0.5.0 usrlib/snapsync-check-is-connection-unmetered.sh