Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ALL/Bash_menu to view info about proc and dev
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
116 lines (90 sloc)
3.87 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
: start | |
clear | |
#=================Function to go Back to Main Menu================== | |
function goto | |
{ | |
label=$1 | |
cmd=$(sed -n "/^:[[:blank:]][[:blank:]]*${label}/{:a;n;p;ba};" $0 | | |
grep -v ':$') | |
eval "$cmd" | |
exit | |
} | |
start=${1:-"start"} | |
#========================Group G Banner============================= | |
echo " ____ ____ " | |
echo " / ___|_ __ ___ _ _ _ __ / ___| " | |
echo "| | _| '__/ _ \| | | | '_ \ | | _ " | |
echo "| |_| | | | (_) | |_| | |_) | | |_| | " | |
echo " \____|_| \___/ \__,_| .__/ \____| " | |
echo " |_| " | |
#==========================INTRO=================================== | |
echo "-------------------------------------" | |
echo "=====================================" | |
echo "__________GROUP_G PRESENTS___________" | |
echo "=====================================" | |
echo "-------------------------------------" | |
echo "Select which information you would like to view:" | |
#===================MAIN MENU============================ | |
select directory in "/proc" "/dev" "/passwd" "Exit" | |
do | |
#===================/PROC MENU=========================== | |
if [ $directory == /proc ]; | |
then | |
select submenu in "memoryinfo" "cgroups" "filesystems" "devices" "buddyinfo" "execdomains" "uptime" "$ | |
do | |
if [ $submenu == memoryinfo ]; | |
then | |
cat /proc/meminfo #this is useful to find out the memory usage | |
elif [ $submenu == cgroups ]; | |
then | |
cat /proc/cgroups #this is helpful to find out what's in /proc/cgroups | |
elif [ $submenu == filesystems ]; | |
then | |
cat /proc/filesystems #Filesystems configured/supported into/by the kernel | |
elif [ $submenu == devices ]; | |
then | |
cat /proc/devices # shows Characters devices and block devices | |
elif [ $submenu == buddyinfo ]; | |
then | |
cat /proc/buddyinfo #This file is used primarily for diagnosing memory fragmentation issues | |
elif [ $submenu == execdomains ]; | |
then | |
cat /proc/execdomains #views execdomains, related to security | |
elif [ $submenu == uptime ]; | |
then | |
cat /proc/uptime #shows the time the system has been up | |
elif [ $submenu == stat ]; | |
then | |
cat /proc/stat #Shows Overall/various statistics about the system, such as the number of pag$ | |
elif [ "$submenu" == Back ]; | |
then | |
goto "$start" #goes back to main menu | |
fi | |
done | |
#=========================/DEV MENU=============================== | |
elif [ $directory == /dev ]; | |
then | |
select submenu in ".container_token" ".host_ip" "Back" | |
do | |
if [ $submenu == .container_token ]; | |
then | |
cat /dev/.container_token #shows info about .container_token | |
elif [ $submenu == .host_ip ]; | |
then | |
cat /dev/.host_ip #shows host's ip | |
elif [ $submenu == Back ]; | |
then | |
goto "$start" #goes back to main menu | |
fi | |
done | |
#========================/PASSWD MENU============================= | |
elif [ $directory == /passwd ]; | |
then | |
cat /etc/passwd #shows contents of passwd directory. Sensitive information | |
#========================EXIT===================================== | |
else [ "$directory" == Exit ] | |
echo "Exiting.........." | |
exit 0 # exits | |
fi | |
done | |