-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'shell' of github.com:gov360/shell into shell
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
# case-menu: a menu driven system information program | ||
clear | ||
echo " | ||
Please Select: | ||
1. Display System Information | ||
2. Display Disk Space | ||
3. Display Home Space Utilization | ||
0. Quit | ||
" | ||
read -p "Enter selection [0-3] > " | ||
case $REPLY in | ||
0) echo "Program terminated." | ||
exit | ||
;; | ||
1) echo "Hostname: $HOSTNAME" | ||
uptime | ||
;; | ||
2) df -h | ||
;; | ||
3) if [[ $(id -u) -eq 0 ]]; then | ||
echo "Home Space Utilization (All Users)" | ||
du -sh /home/* | ||
else | ||
echo "Home Space Utilization ($USER)" | ||
du -sh $HOME | ||
fi | ||
;; | ||
*) echo "Invalid entry" >&2 | ||
exit 1 | ||
;; | ||
esac |