Skip to content

Commit

Permalink
fix wfetch when commands are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
WaylonWalker committed Feb 28, 2024
1 parent 6300945 commit 9dcaf90
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bin/.local/bin/wfetch
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,23 @@ get_os () {

get_os
# os=`lsb_release -d | awk '{printf "%s %s", $2, $3}'`
rootFree=`lsblk | awk '{if (length($7)==1) print $4}'`
if [[ `command -v lsblk` ]]; then
rootFree=`lsblk | awk '{if (length($7)==1) print $4}'`
else
rootFree=''
fi
# check of system has the free command
if command -v free &> /dev/null; then
memAvailable=`free -m | grep "Mem" | awk '{printf "%.1fG", $7/1024}'`
else
memAvailable='-'
fi
cpuTemp=`echo ?` #`sensors | grep CPU | awk '{print $2}' | sed 's/+//' | tr -d '\n'`
loadAvg=`cat /proc/loadavg | awk '{printf "%s %s %s", $1, $2, $3}'`
if [[ -f /proc/loadavg ]]; then
loadAvg=`cat /proc/loadavg | awk '{printf "%s %s %s", $1, $2, $3}'`
else
loadAvg=''
fi
if ! command -v /opt/cisco/anyconnect/bin/vpn &> /dev/null; then
proxy=
elif [[ "$(/opt/cisco/anyconnect/bin/vpn status)" == *"state: Disconnected"* ]]; then
Expand Down

0 comments on commit 9dcaf90

Please sign in to comment.