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 5aa8c946
authored
Sep 11, 2020
by
irul
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Penambahan fungsi cek status situs web
1 parent
9be3a71e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
server_info.sh
server_info.sh
View file @
5aa8c94
...
...
@@ -107,9 +107,23 @@ echo ""
if
dpkg --get-selections | grep -E
'(^|\s)apache2($|\s)'
&> /dev/null
then
echo
"== Sites Available =="
echo
-e
`
apache2ctl -S 2>&1 | grep
"namevhost"
| awk
'{print "(" NR ") " $4}'
`
echo
""
echo
"== Sites Available =="
;
#echo -e `apache2ctl -S 2>&1 | grep "namevhost" | awk '{print "(" NR ") " $4}'`
SITES
=
$(
echo
`
apache2ctl -S 2>&1 | grep
"namevhost"
| awk
'{print $4}'
`
)
#echo "Sites: $SITES";
SITES_CNT
=
1
for
SITE
in
$SITES
do
if
curl -I
"
$SITE
"
2>&1 | grep -w
"200
\|
301"
> /dev/null ;
then
echo
"
$SITES_CNT
$SITE
is up"
else
echo
"
$SITES_CNT
$SITE
is down"
fi
SITES_CNT
=
$[$SITES_CNT
+1]
done
echo
""
;
fi
echo
"Last Check: "
$(
date
'+%Y-%m-%d %H:%M'
)
...
...
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