Expose expiry character configuration
[khatus.git] / x1 / bin / khatus_update_network
1 #! /bin/bash
2
3 set -e
4
5 #TERM=xterm-256color # To keep unicode charcters from BARS
6
7 STATUS_DIR=$HOME/var/run/status
8 STATUS_FILE_WIFI=$STATUS_DIR/wifi
9 STATUS_FILE_ETH=$STATUS_DIR/eth
10
11 mkdir -p $STATUS_DIR
12
13 # nmcli d \
14 # | awk \
15 # -v file_wifi="$STATUS_FILE_WIFI" \
16 # -v file_eth="$STATUS_FILE_ETH" \
17 # '
18 # $2 == "wifi" {wifi = $4}
19 # $2 == "ethernet" {eth=$4}
20 # END {
21 # print(wifi) > file_wifi;
22 # print(eth) > file_eth;
23 # }
24 # '
25
26 nmcli \
27 -f ACTIVE,SSID,SIGNAL \
28 -t \
29 d wifi \
30 | awk \
31 -F ':' \
32 -v file_wifi="$STATUS_FILE_WIFI" \
33 '
34 BEGIN {wifi_status = "--"}
35 $1 == "yes" {wifi_status = $2 ":" $3 "%"}
36 END {print wifi_status > file_wifi}
37 '
This page took 0.088321 seconds and 4 git commands to generate.