Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
server-monitor
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
server-monitor
Commits
a7884e2c
There was an error fetching the commit references. Please try again later.
Verified
Commit
a7884e2c
authored
6 years ago
by
Recolic Keghart
Browse files
Options
Downloads
Patches
Plain Diff
better ping, add rocket, remove ddns-usa
parent
f78b7061
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
datafile_gen_daemon_conf.py
+1
-1
1 addition, 1 deletion
datafile_gen_daemon_conf.py
do.bash
+38
-15
38 additions, 15 deletions
do.bash
with
39 additions
and
16 deletions
datafile_gen_daemon_conf.py
+
1
−
1
View file @
a7884e2c
...
...
@@ -16,7 +16,7 @@ tests = [
(
'
./do.bash mc
'
,
'
Minecraft Server
'
),
(
'
./do.bash push-httpdb-agent
'
,
'
httpdb
'
),
(
'
./do.bash ddns-wuhan
'
,
'
DDNS WuHan
'
),
(
'
./do.bash
ddns-us
'
,
'
DDNS USA
'
),
(
'
./do.bash
rocket
'
,
'
Recolic Rocket Chat
'
),
(
'
./do.bash dl
'
,
'
Download Site
'
),
(
'
./do.bash shortlink
'
,
'
Short Link
'
),
]
...
...
This diff is collapsed.
Click to expand it.
do.bash
+
38
−
15
View file @
a7884e2c
#!/bin/bash
[[
$1
==
''
]]
&&
echo
-e
'Usage: '
"
$0
<operation> ...
\n
operation := rproxy | drive | ss-tw | ss-us1 | ss-us5 | ss-us6 | ovpn-tw | www | mail | tm | git | zhixiang | mc | push-httpdb-agent | ddns-wuhan |
ddns-us
| dl | shortlink | all"
&&
exit
1
[[
$1
==
''
]]
&&
echo
-e
'Usage: '
"
$0
<operation> ...
\n
operation := rproxy | drive | ss-tw | ss-us1 | ss-us5 | ss-us6 | ovpn-tw | www | mail | tm | git | zhixiang | mc | push-httpdb-agent | ddns-wuhan |
rocket
| dl | shortlink | all"
&&
exit
1
function
confirm_alive
()
{
local
host
=
"
$1
"
timeout
4s ping
"
$host
"
-c
2
timeout
4s ping
"
$host
"
-c
1
local
ret
=
"
$?
"
[[
$ret
!=
124
]]
&&
return
$ret
[[
$ret
!=
124
]]
&&
[[
$ret
!=
2
]]
&&
return
$ret
for
i
in
{
1..4
}
;
do
timeout
2s ping
"
$host
"
-c
1
&&
return
0
timeout
3s ping
"
$host
"
-c
1
&&
return
0
sleep
1
done
return
124
}
...
...
@@ -69,23 +70,36 @@ function do_test () {
curl
-s
-L
http://recolic.net/ |
grep
'Follow me on github'
||
return
$?
;;
mail
)
confirm_alive smtp.recolic.net
&&
confirm_alive imap.recolic.net
&&
confirm_alive mail.recolic.net
&&
confirm_alive pop3.recolic.net
||
return
$?
# Fucking DigitalOcean
# test_tcp smtp.recolic.net 25 | grep 220 || return $?
test_tcp smtp.recolic.net 587 |
grep
220
||
return
$?
# test_tcp imap.recolic.net 143 | grep OK || return $?
if
test_tcp smtp-mail.outlook.com 25 |
grep
220
;
then
test_tcp smtp.recolic.net 25 |
grep
220
||
return
$?
fi
test_tcp smtp.recolic.net 587
||
return
$?
if
test_tcp imap-mail.outlook.com 143 |
grep
OK
;
then
test_tcp imap.recolic.net 143 |
grep
OK
||
return
$?
fi
test_tcp imap.recolic.net 993
||
return
$?
# test_tcp pop3.recolic.net 110 | grep OK || return $?
if
test_tcp pop3.live.com 110 |
grep
OK
;
then
test_tcp pop3.recolic.net 110 |
grep
OK
||
return
$?
fi
test_tcp pop3.recolic.net 995
||
return
$?
curl
-s
https://mail.recolic.net/mail/ |
grep
'Welcome to Roundcube'
||
return
$?
curl http://mail.recolic.net/
-vv
2>&1 |
grep
'https://mail.recolic.net/'
||
return
$?
;;
tm
)
confirm_alive tm.recolic.net
&&
curl
-s
https://tm.recolic.net/ |
grep
inputButtonCss
&&
curl
-s
http://tm.recolic.net/
-L
|
grep
inputButtonCss
||
return
$?
curl
-s
'https://tm.recolic.net/addtask?openid=23251fc131e118d07fc9932f3c3de92c&N=30.508914&E=114.40718&key=FUCKYOU'
|
grep
'invalid key'
||
return
$?
;;
git
)
confirm_alive git.recolic.net
&&
curl
-s
https://git.recolic.net/ |
grep
'users/sign_in'
&&
curl
-s
http://git.recolic.net/
-L
|
grep
'users/sign_in'
||
return
$?
;;
...
...
@@ -95,30 +109,39 @@ function do_test () {
curl
-k
-X
POST
-s
'https://api.anjie-elec.cn/api/usewater/Add?accessToken=FUCKYOU'
|
grep
'104871845A503324'
||
return
$?
;;
mc
)
confirm_alive mc.recolic.net
&&
test_tcp mc.recolic.net 25565
||
return
$?
;;
push-httpdb-agent
)
local
r
=
"
$RANDOM
"
confirm_alive git.recolic.net
&&
curl
-s
"https://git.recolic.net/_r_testing/set/_status_test|
$r
"
&&
local
result
=
$(
curl
-s
"https://git.recolic.net/_r_testing/get/_status_test"
)
||
return
$?
[[
$r
=
$result
]]
return
$?
;;
ddns-wuhan
)
confirm_alive base.ddns1.recolic.net
&&
test_tcp base.ddns1.recolic.net 22
||
return
$?
;;
ddns-us
)
test_tcp base.ddns2.recolic.net 22 |
grep
SSH
&&
test_tcp base.ddns2.recolic.net 80
&&
test_tcp nohsts.ddns2.recolic.org 22 |
grep
SSH
&&
test_tcp nohsts.ddns2.recolic.org 80
||
return
$?
;;
#
ddns-us )
#
test_tcp base.ddns2.recolic.net 22 | grep SSH &&
#
test_tcp base.ddns2.recolic.net 80 &&
#
test_tcp nohsts.ddns2.recolic.org 22 | grep SSH &&
#
test_tcp nohsts.ddns2.recolic.org 80 || return $?
#
;;
dl
)
confirm_alive dl.recolic.net
&&
curl
-s
-L
https://dl.recolic.net/ |
grep
'Home page is not provided for this download site'
||
return
$?
;;
shortlink
)
confirm_alive recolic.net
&&
curl
-s
'https://recolic.net/go/index.php'
--data
'target=https%3A%2F%2Fwww.google.com&name=google&super='
|
grep
Success
||
return
$?
;;
rocket
)
confirm_alive rocket.recolic.net
&&
curl
-s
https://rocket.recolic.net/api/info |
grep
'success":true'
||
return
$?
;;
esac
}
...
...
@@ -143,7 +166,7 @@ if [[ "$1" = all ]]; then
do_test_twice mc
&&
do_test_twice push-httpdb-agent
&&
do_test_twice ddns-wuhan
&&
do_test_twice
ddns-us
&&
do_test_twice
rocket
&&
do_test_twice shortlink
&&
do_test_twice dl
exit
$?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment