Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon
Commits
d8145f83
Unverified
Commit
d8145f83
authored
2 weeks ago
by
Andreas Ziegler
Committed by
GitHub
2 weeks ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #3457 from neocturne/shellcheck
gluon-mesh-vpn-wireguard: fix shellcheck warnings in netifd proto
parents
377b03b9
e1bb8949
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/gluon-mesh-vpn-wireguard/files/lib/netifd/proto/gluon_wireguard.sh
+6
-14
6 additions, 14 deletions
...h-vpn-wireguard/files/lib/netifd/proto/gluon_wireguard.sh
with
6 additions
and
14 deletions
package/gluon-mesh-vpn-wireguard/files/lib/netifd/proto/gluon_wireguard.sh
+
6
−
14
View file @
d8145f83
...
@@ -2,25 +2,18 @@
...
@@ -2,25 +2,18 @@
# shellcheck disable=SC1091
# shellcheck disable=SC1091
# FIXME: The following lints should not need to be disabled
# shellcheck disable=SC2034,SC2155
PROTO_DEBUG
=
1
.
/lib/functions.sh
.
/lib/functions.sh
.
../netifd-proto.sh
.
../netifd-proto.sh
init_proto
"
$@
"
init_proto
"
$@
"
WG
=
/usr/bin/wg
proto_gluon_wireguard_init_config
()
{
proto_gluon_wireguard_init_config
()
{
proto_config_add_int index
:
proto_config_add_int mtu
}
}
interface_linklocal_from_wg_public_key
()
{
interface_linklocal_from_wg_public_key
()
{
# We generate a predictable v6 address
# We generate a predictable v6 address
local
macaddr
=
"
$(
printf
"%s"
"
$1
"
|md5sum|sed
's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/'
)
"
local
macaddr
macaddr
=
"
$(
printf
"%s"
"
$1
"
|md5sum|sed
's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/'
)
"
local
oldIFS
=
"
$IFS
"
;
IFS
=
':'
;
local
oldIFS
=
"
$IFS
"
;
IFS
=
':'
;
# shellcheck disable=SC2086
# shellcheck disable=SC2086
set
--
$macaddr
;
IFS
=
"
$oldIFS
"
set
--
$macaddr
;
IFS
=
"
$oldIFS
"
...
@@ -31,14 +24,13 @@ proto_gluon_wireguard_setup() {
...
@@ -31,14 +24,13 @@ proto_gluon_wireguard_setup() {
local
config
=
"
$1
"
local
config
=
"
$1
"
local
ifname
=
"
$2
"
local
ifname
=
"
$2
"
local
index mtu
local
public_key
json_get_vars index mtu
public_key
=
"
$(
/lib/gluon/mesh-vpn/wireguard_pubkey.sh
)
"
local
public_key
=
"
$(
/lib/gluon/mesh-vpn/wireguard_pubkey.sh
)
"
# The wireguard proto itself can not be moved here, as the proto does not
# The wireguard proto itself can not be moved here, as the proto does not
# allow add_dynamic.
# allow add_dynamic.
local
wireguard_ip
wireguard_ip
=
$(
interface_linklocal_from_wg_public_key
"
$public_key
"
)
wireguard_ip
=
$(
interface_linklocal_from_wg_public_key
"
$public_key
"
)
## Add IP
## Add IP
...
...
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