-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSystemCheck.sh
More file actions
executable file
·71 lines (60 loc) · 1.26 KB
/
Copy pathSystemCheck.sh
File metadata and controls
executable file
·71 lines (60 loc) · 1.26 KB
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
69
70
71
#!/bin/bash
#Description system inventory on demand
#Author: Nkolo G
#Date: October 2019
#Modified on: by :
## checking if user is root
if [ $UID -ne 0 ]
then
echo e "\n you need root access...\n"
exit 1
fi
echo -e "\nplease make a choice below: \n
******************************** *
* 1- cpu *
* 2- memory *
* 3- os version *
* 4- processes *
* 5- system bits *
* 6- mount point *
* 7- ip address *
* 8- Hostname *
* 9- kernel version *
* 10- update os *
**********************************"
echo -n " Enter your choice(1 -10: "
read ans
if [ ${ans} -eq 1 ]
then
lscpu
elif [ ${ans} -eq 2 ]
then
free -m
elif [ ${ans} -eq 3 ]
then
cat/etc/*release
elif [ ${ans} -eq 4 ]
then
ps -ef | wc -1
elif [ ${ans} -eq 5 ]
then
getconf LONG_BIT
elif [ ${ans} -eq 6 ]
then
df -h
elif [ ${ans} -eq 7 ]
then
ip a
elif [ ${ans} -eq 8 ]
then
hostname
elif [ ${ans} -eq 9 ]
then
uname -r
elif [ ${ans} -eq 10 ]
then
yum update -y
else
echo -e "\nplease enter a valid choice (1 -10) \n"
exit 2
fi