-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchg_lan.sh
executable file
·21 lines (17 loc) · 964 Bytes
/
chg_lan.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
# @(#) $Id: chg_lan.sh,v 1.3 2024/03/09 09:23:52 ralph Exp $
# -------------------------------------------------------------------------
# $Header: /home/cvs/src/unix/conky-osl/chg_lan.sh,v 1.3 2024/03/09 09:23:52 ralph Exp $
# vim:ts=8:sw=4:sts=4
# coding: utf-8 -*- http://rose.rult.at/ - (c) by Ralph Roth, ROSE SWE
# -------------------------------------------------------------------------
# The network statistics are currently hard coded (eth0).
# So if you have an other interface you must adapt (e.g sed) this to your environment!
# For a quick fix we provide the shell script "chg_lan.sh" that changes eth0
# to your first available interface.
LANIF=$(ip a show | grep "state UP" | awk {'print $2;'} | tr -d ":" | head -1)
echo "$0: Using network interface ${LANIF}"
sed 's/eth0/'${LANIF}'/g' < conky-osl.conf > conky-osl-fixedlan.conf
RC=$?
[ "${RC}" -eq 0 ] && cp conky-osl-fixedlan.conf ~/.config/conky/conky.conf
exit ${RC}