Delete 80-update-htop-and-offload-tx
- users are "confused" about manipulating files in their home directories - introduced security issues which have been worked around but there might be others too - more recent htop may support network stuff oob (https://armbian.atlassian.net/browse/AR-771?focusedCommentId=10546)
This commit is contained in:
parent
fc892b7e3f
commit
1f2dc3423a
@ -1,52 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# adjust htop settings for all normal users and root
|
||||
#
|
||||
|
||||
. /etc/armbian-release
|
||||
|
||||
TempFile="$(mktemp /tmp/${0##*/}.XXXXXX || exit 1)"
|
||||
trap "rm \"${TempFile}\" ; exit 0" 0 1 2 3 15
|
||||
|
||||
for homedir in $(awk -F'[:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $6}' /etc/passwd); do
|
||||
|
||||
unset FIELDS FIELD_PARA
|
||||
|
||||
# start with a clean copy
|
||||
cp /etc/skel/.config/htop/htoprc "${homedir}"/.config/htop/htoprc
|
||||
|
||||
for TYPE in ethernet wifi; do
|
||||
|
||||
i=0
|
||||
for INTERFAC in $(LC_ALL=C nmcli device status | grep $TYPE | grep -w connected | awk '{ print $1 }' | grep -v lo | grep -v p2p | head -2); do
|
||||
|
||||
[[ $TYPE == ethernet ]] && type="eth"; [[ $TYPE == wifi ]] && type="wlan"
|
||||
|
||||
FIELDS+="${type^}$i ${type^}${i}stat "
|
||||
FIELD_PARA+="2 2 "
|
||||
sed "s/^${type}${i}_alias=.*/${type}${i}_alias=$INTERFAC/" "${homedir}"/.config/htop/htoprc >"${TempFile}"
|
||||
cat "${TempFile}" >"${homedir}"/.config/htop/htoprc
|
||||
|
||||
((i=i+1))
|
||||
done
|
||||
done
|
||||
|
||||
FIELDS=$(echo $FIELDS | xargs)
|
||||
FIELD_PARA=$(echo $FIELD_PARA | xargs)
|
||||
|
||||
echo "$FIELDS $FIELD_PARA"
|
||||
|
||||
sed "s/right_meters.*$/& $FIELDS/" "${homedir}"/.config/htop/htoprc >"${TempFile}"
|
||||
cat "${TempFile}" >"${homedir}"/.config/htop/htoprc
|
||||
sed "s/right_meter_modes.*$/& $FIELD_PARA/" "${homedir}"/.config/htop/htoprc >"${TempFile}"
|
||||
cat "${TempFile}" >"${homedir}"/.config/htop/htoprc
|
||||
|
||||
# enable GPU where this works
|
||||
if [[ $LINUXFAMILY == meson64 || $LINUXFAMILY == odroidxu4 ]]; then
|
||||
sed "s/left_meters.*$/& GpuTemp/" "${homedir}"/.config/htop/htoprc >"${TempFile}"
|
||||
cat "${TempFile}" >"${homedir}"/.config/htop/htoprc
|
||||
sed "s/left_meter_modes.*$/& 2/" "${homedir}"/.config/htop/htoprc >"${TempFile}"
|
||||
cat "${TempFile}" >"${homedir}"/.config/htop/htoprc
|
||||
fi
|
||||
|
||||
done
|
||||
Loading…
Reference in New Issue
Block a user