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
d8d886e7
There was an error fetching the commit references. Please try again later.
Commit
d8d886e7
authored
5 years ago
by
Recolic Keghart
Browse files
Options
Downloads
Patches
Plain Diff
update do.bash
parent
a7884e2c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
do.bash
+9
-7
9 additions, 7 deletions
do.bash
with
9 additions
and
7 deletions
do.bash
+
9
−
7
View file @
d8d886e7
#!/bin/bash
#!/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 | rocket | dl | shortlink | all"
&&
exit
1
[[
$1
==
''
]]
&&
echo
-e
'Usage: '
"
$0
<operation> ...
\n
operation := rproxy | drive | ssr-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
[[
$(
id
-u
)
=
0
]]
&&
ping_fld
=
"-f"
function
confirm_alive
()
{
function
confirm_alive
()
{
local
host
=
"
$1
"
local
host
=
"
$1
"
...
@@ -8,7 +10,7 @@ function confirm_alive () {
...
@@ -8,7 +10,7 @@ function confirm_alive () {
local
ret
=
"
$?
"
local
ret
=
"
$?
"
[[
$ret
!=
124
]]
&&
[[
$ret
!=
2
]]
&&
return
$ret
[[
$ret
!=
124
]]
&&
[[
$ret
!=
2
]]
&&
return
$ret
for
i
in
{
1..4
}
;
do
for
i
in
{
1..4
}
;
do
timeout
3
s ping
"
$host
"
-c
1
&&
return
0
timeout
12
s ping
"
$host
"
-c
1
$ping_fld
&&
return
0
sleep
1
sleep
1
done
done
return
124
return
124
...
@@ -39,11 +41,11 @@ function do_test () {
...
@@ -39,11 +41,11 @@ function do_test () {
;;
;;
drive
)
drive
)
confirm_alive drive.recolic.net
&&
confirm_alive drive.recolic.net
&&
curl
-s
https://drive.recolic.net/index.php/login |
grep
'submit-wrapper'
||
return
$?
curl
-s
https://drive.recolic.net
:444
/index.php/login |
grep
'submit-wrapper'
||
return
$?
;;
;;
ss-tw
)
ss
r
-tw
)
confirm_alive nohsts.tw1.recolic.org
&&
confirm_alive nohsts.tw1.recolic.org
&&
test_
ss
base.tw1.recolic.net
||
return
$?
test_
tcp
base.tw1.recolic.net
465
||
return
$?
;;
;;
ss-us1
)
ss-us1
)
test_ss base.us1.recolic.net
||
return
$?
test_ss base.us1.recolic.net
||
return
$?
...
@@ -140,7 +142,7 @@ function do_test () {
...
@@ -140,7 +142,7 @@ function do_test () {
;;
;;
rocket
)
rocket
)
confirm_alive rocket.recolic.net
&&
confirm_alive rocket.recolic.net
&&
curl
-s
https://rocket.recolic.net/api/info |
grep
'success":true'
||
return
$?
curl
-s
https://rocket.recolic.net
:444
/api/info |
grep
'success":true'
||
return
$?
;;
;;
esac
esac
}
}
...
@@ -153,7 +155,7 @@ function do_test_twice () {
...
@@ -153,7 +155,7 @@ function do_test_twice () {
if
[[
"
$1
"
=
all
]]
;
then
if
[[
"
$1
"
=
all
]]
;
then
do_test_twice rproxy
&&
do_test_twice rproxy
&&
do_test_twice drive
&&
do_test_twice drive
&&
do_test_twice ss-tw
&&
do_test_twice ss
r
-tw
&&
do_test_twice ss-us1
&&
do_test_twice ss-us1
&&
do_test_twice ss-us5
&&
do_test_twice ss-us5
&&
do_test_twice ss-us6
&&
do_test_twice ss-us6
&&
...
...
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