-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmegamenu.sh
executable file
·68 lines (64 loc) · 1.7 KB
/
megamenu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# megamenu: a menu of system information and various terminal baffoonery.
declare -a menuarray=('APT Update' 'Display Disk Space' 'Display System Information' 'Get Network (local) IP Address' 'Path Includes' 'Week of the Year' 'When is Easter?' 'Watch Star Wars Instead' 'Quit');
for (( i=0; i<${#menuarray[@]}; i++ ))
do
menu=$menu"$(($i+1))) ${menuarray[i]}"$'\n'
done
while [[ 1 ]]
do
echo "$(tput setaf 4)$menu" # 0 black, 1 red, 2 green, 3 yellow, 4 blue, 5 magenta, 6 cyan, 7 white
read -p "Enter Selection, $USER [1-9] > "
clear
case $REPLY in
0) xdg-open https://www.d3c3p7.com 2>/dev/null || open https://www.d3c3p7.com
;;
1) sudo apt update; sudo apt upgrade -y; sudo apt autoremove -y
;;
2) df -h
echo ""
;;
3) echo " Hostname: $HOSTNAME"
echo ""
uptime
echo ""
;;
4) echo "I know where you are:"
echo ""
dig +short myip.opendns.com @resolver1.opendns.com
echo ""
;;
5) echo "Weak human, this is your \$PATH:"
echo ""
echo -e ${PATH//:/\\n}
echo ""
;;
6) echo "The week is... "
echo ""
date +%V
echo ""
;;
7) echo "This year's Easter is on "
echo ""
ncal -e
echo ""
;;
8) nc towel.blinkenlights.nl 23
;;
9) arr[0]="Humans don't deserve to live!"
arr[1]="You fail me yet again, Starscream. GET THEM!"
arr[2]="Is it fear or courage that compels you, fleshling?"
arr[3]="Give me the Allspark, and you may live to be my pet."
rand=$(( RANDOM % 4 ))
echo "${arr[$rand]}"
echo ""
break
;;
t) for (( i = 0; i < 17; i++)); do echo "$(tput setaf $i)This is $i $(tput sgr0)";done
;;
*) echo "$(tput setaf 1)Megacron has labeled $USER as Invalid" >&2
echo ""
exit 1
;;
esac
done