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 e9535df7
authored
Sep 10, 2020
by
irul
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Mengganti grep ip yg lebih informatif
1 parent
295d62f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
server_info.sh
server_info.sh
View file @
e9535df
...
@@ -22,7 +22,9 @@ echo ""
...
@@ -22,7 +22,9 @@ echo ""
echo
-e
"Operating System: "
`
cat /etc/
*
release | grep PRETTY_NAME | cut -d
"="
-f 2 | tr -d
'"'
`
echo
-e
"Operating System: "
`
cat /etc/
*
release | grep PRETTY_NAME | cut -d
"="
-f 2 | tr -d
'"'
`
echo
-e
"Using Systemd: "
`
pidof systemd
&&
echo
"True"
||
echo
"False"
`
echo
-e
"Using Systemd: "
`
pidof systemd
&&
echo
"True"
||
echo
"False"
`
echo
-e
"Hostname: "
`
hostname
`
echo
-e
"Hostname: "
`
hostname
`
echo
-e
"Server IP: "
`
hostname -I
`
echo
""
# echo -e "Server IP: "`hostname -I`
echo
-e
"Server IP: "
`
/sbin/ip -4 a | grep
"inet "
| tail -n +2 | awk
'{print $7 "=" $2}'
`
echo
-e
"Default Gateway: "
`
ip route show | sed
's/\(\S\+\s\+\)\?default via \(\S\+\).*/\2/p; d'
`
echo
-e
"Default Gateway: "
`
ip route show | sed
's/\(\S\+\s\+\)\?default via \(\S\+\).*/\2/p; d'
`
echo
-e
"Uptime: "
`
uptime | awk
'{print $3,$4}'
| sed
's/,//'
`
echo
-e
"Uptime: "
`
uptime | awk
'{print $3,$4}'
| sed
's/,//'
`
echo
""
echo
""
...
...
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