Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jenny Ryan
ouinet
Commits
0bd405d8
Commit
0bd405d8
authored
Nov 12, 2020
by
Ivan Vilata-i-Balaguer
Browse files
Remove some redundant variables in ping swarm script.
parent
c190402b
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/ping-swarm
View file @
0bd405d8
...
...
@@ -24,10 +24,7 @@ set -e
#OUI_PROTO="${OUI_PROTO:-5}"
#OUI_INJPK="${OUI_INJPK:-abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrst}"
v
=
"
$OUI_PROTO
"
pk
=
"
$OUI_INJPK
"
if
[
!
"
$v
"
-o
!
"
$pk
"
]
;
then
if
[
!
"
$OUI_PROTO
"
-o
!
"
$OUI_INJPK
"
]
;
then
echo
"Please set OUI_PROTO and OUI_INJPK."
>
/dev/stderr
exit
1
fi
...
...
@@ -71,10 +68,10 @@ for group in "$@"; do
# swarm = "ed25519:<base32up_encode(pubkey)>/v<VERSION>/<GROUP>"
case
"
$group
"
in
injectors|bridges
)
swarm
=
"ed25519:
$
pk
/v
$v
/
$group
"
swarm
=
"ed25519:
$
OUI_INJPK
/v
$OUI_PROTO
/
$group
"
;;
*
)
swarm
=
"ed25519:
$
pk
/v
$v
/uri/
$group
"
swarm
=
"ed25519:
$
OUI_INJPK
/v
$OUI_PROTO
/uri/
$group
"
esac
# infohash = sha1(swarm)
infohash
=
"
$(
echo
-n
"
$swarm
"
|
sha1sum
|
cut
-d
' '
-f1
)
"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment