Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
irul
/
tools
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4cffc193
authored
Sep 13, 2020
by
irul
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update server_info.sh
1 parent
40667698
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
server_info.sh
server_info.sh
View file @
4cffc19
...
@@ -34,11 +34,11 @@ echo -e "Memory(RAM): "`free -mht| awk '/Mem/{print $2 " |Used: "$3 " |Free: "$4
...
@@ -34,11 +34,11 @@ echo -e "Memory(RAM): "`free -mht| awk '/Mem/{print $2 " |Used: "$3 " |Free: "$4
echo
-e
"Swap Memory: "
`
free -mht| awk
'/Swap/{print $2 " |Used: "$3 " |Free: "$4}'
`
echo
-e
"Swap Memory: "
`
free -mht| awk
'/Swap/{print $2 " |Used: "$3 " |Free: "$4}'
`
echo
""
echo
""
MTYPE
=
$(
echo
`
vserver
=
$(
lscpu | grep Hypervisor | wc -l
)
;
echo
$vserver
`
)
#
MTYPE=$(echo `vserver=$(lscpu | grep Hypervisor | wc -l); echo $vserver`)
if
[
$MTYPE
-eq 0
]
;
then
#
if [ $MTYPE -eq 0 ]; then
#echo -e "Disk Usage: "`df -h --total | grep "/dev/" | grep -v "loop" | grep -v "tmpfs" | sort`
#echo -e "Disk Usage: "`df -h --total | grep "/dev/" | grep -v "loop" | grep -v "tmpfs" | sort`
echo
-e
"== Disk Usage == "
echo
-e
"== Disk Usage == "
df -h --total | grep -v
"loop
"
| grep -v
"tmpfs"
| grep -v
"udev
"
|
while
read
-r line ;
do
df -h --total | grep -v
"loop
\|
tmpfs
\|
udev
\|
none
\|
shm
"
|
while
read
-r line ;
do
if
grep -q
"Sistem"
<<<
"
$line
"
||
grep -q
"Filesystem"
<<<
"
$line
"
||
grep -q
"total"
<<<
"
$line
"
;
then
if
grep -q
"Sistem"
<<<
"
$line
"
||
grep -q
"Filesystem"
<<<
"
$line
"
||
grep -q
"total"
<<<
"
$line
"
;
then
str
=
"[_]
$line
"
str
=
"[_]
$line
"
echo
"
${
str
/total/Total
}
"
echo
"
${
str
/total/Total
}
"
...
@@ -47,7 +47,7 @@ if [ $MTYPE -eq 0 ]; then
...
@@ -47,7 +47,7 @@ if [ $MTYPE -eq 0 ]; then
fi
fi
done
done
echo
""
echo
""
fi
#
fi
echo
-e
"== Base Application =="
echo
-e
"== Base Application =="
...
@@ -149,7 +149,7 @@ if dpkg --get-selections | grep -E '(^|\s)apache2($|\s)' &> /dev/null ; then
...
@@ -149,7 +149,7 @@ if dpkg --get-selections | grep -E '(^|\s)apache2($|\s)' &> /dev/null ; then
fi
fi
if
dpkg --get-selections | grep -E
'(^|\s)nginx($|\s)'
&> /dev/null ;
then
if
dpkg --get-selections | grep -E
'(^|\s)nginx($|\s)'
&> /dev/null ;
then
SITES
=
$(
echo
`
grep server_name /etc/nginx/sites-enabled/
*
-RiI|cut -d
"/"
-f5-|cut -d
":"
-f1|rev|cut -d
"."
-f2-|rev|grep -v
"default
"
|grep -v
"#"
|grep -v
"_;"
|grep -v
"server_name"
|grep -v
"
example"
|sort|uniq
`
)
SITES
=
$(
echo
`
grep server_name /etc/nginx/sites-enabled/
*
-RiI|cut -d
"/"
-f5-|cut -d
":"
-f1|rev|cut -d
"."
-f2-|rev|grep -v
"default
\|
#
\|
_;
\|
server_name
\|
example"
|sort|uniq
`
)
if
[
! -z
"
$SITES
"
]
;
then
if
[
! -z
"
$SITES
"
]
;
then
echo
"== Sites Available (Nginx) =="
;
echo
"== Sites Available (Nginx) =="
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment