parent
9a34944e30
commit
748bcc2301
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Just having fun with unicode characters
|
||||
#symbols=("\U25DC" "\U25DD" "\U25DE" "\U25DF") # Circle outlines
|
||||
symbols=("\U25CB" "\U25D4" "\U25D1" "\U25D5" "\U25CF") # Pie chart
|
||||
|
||||
trap ctrl_c INT
|
||||
function ctrl_c {
|
||||
tput cub1
|
||||
tput cnorm
|
||||
echo
|
||||
exit
|
||||
}
|
||||
|
||||
tput civis
|
||||
|
||||
index=0
|
||||
while true; do
|
||||
|
||||
echo -en ${symbols[$index]}
|
||||
let index=$index+1
|
||||
[ $index -eq ${#symbols[@]} ] && index=0
|
||||
sleep .25
|
||||
tput cub1
|
||||
|
||||
done
|
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
[ -z $1 ] && index=0 || index=$1
|
||||
disks=('/dev/sda1' '/dev/sda15')
|
||||
[ ${#index} -gt 1 ] && disks=("$index") && index=0
|
||||
|
||||
|
||||
_df=`df -h | tr -s [:blank:] | egrep "^${disks[${index}]} "`
|
||||
|
||||
disk=`echo $_df | cut -d' ' -f1` # /dev/sda1
|
||||
size=`echo $_df | cut -d' ' -f2` # 20G
|
||||
used=`echo $_df | cut -d' ' -f3` # 16G
|
||||
left=`echo $_df | cut -d' ' -f4` # 6.1G
|
||||
perc=`echo $_df | cut -d' ' -f5` # 69%
|
||||
mntp=`echo $_df | cut -d' ' -f6` # /
|
||||
rper=`echo $perc | tr -d "%"` # 69
|
||||
|
||||
|
||||
echo "Disk: $disk"
|
||||
echo "Space: $used/$size"
|
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
servers=('nbg.icmp.hetzner.com' 'fsn.icmp.hetzner.com' 'hel.icmp.hetzner.com' 'ash.icmp.hetzner.com' 'dismyserver.net')
|
||||
names=('Nuremberg' 'Falkenstein' 'Helsinki' 'Ashburn, VA' 'OVH Canada')
|
||||
|
||||
regex="time=[0-9 \.]+ms"
|
||||
|
||||
for index in $(seq 0 $((${#servers[@]}-1))); do
|
||||
domain=${servers[$index]}
|
||||
name=${names[$index]}
|
||||
pingdata=`ping -c1 ${domain}`
|
||||
delay=`echo -e $pingdata | egrep -o "${regex}"`
|
||||
[ ${#domain} -lt 20 ] && tabs="\t\t" || tabs="\t"
|
||||
echo -e "${name}\t${domain}${tabs}${delay}"
|
||||
done
|
Loading…
Reference in new issue