-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
falter-common: apply shellcheck-fixes
exclude hna.lua from linter. Signed-off-by: Martin Hübner <martin.hubner@web.de>
- Loading branch information
Showing
21 changed files
with
111 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
# Freifunk Init | ||
# $Id$ | ||
|
||
# shellcheck disable=SC2034 | ||
# shellcheck disable=SC1090 | ||
|
||
START=99 | ||
|
||
boot() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/falter-common/files/etc/uci-defaults/freifunk-berlin-network-ip-route
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/bin/sh | ||
|
||
# shellcheck disable=SC1091 | ||
|
||
. /lib/functions/guard.sh | ||
guard "iproute" | ||
|
||
|
3 changes: 3 additions & 0 deletions
3
packages/falter-common/files/etc/uci-defaults/freifunk-berlin-olsrd-defaults
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
#!/bin/sh | ||
|
||
# shellcheck disable=SC1091 | ||
# shellcheck disable=SC2086 | ||
|
||
. /lib/functions/guard.sh | ||
guard "olsrd" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
packages/falter-common/files/etc/uci-defaults/freifunk-berlin-system-defaults
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/falter-common/files/etc/uci-defaults/freifunk-berlin-uhttpd-defaults
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/bin/sh | ||
|
||
# shellcheck disable=SC1091 | ||
|
||
. /lib/functions/guard.sh | ||
guard "uhttpd" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 28 additions & 24 deletions
52
packages/falter-common/files/lib/functions/freifunk-berlin-network.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,40 @@ | ||
#!/bin/sh | ||
|
||
# shellcheck shell=dash | ||
# shellcheck disable=SC2034 | ||
# shellcheck disable=SC1091 | ||
|
||
. /lib/functions/guard.sh | ||
|
||
create_ffuplink() { | ||
uci -q delete network.ffuplink | ||
# create a very basic ffuplink interface | ||
uci set network.ffuplink=interface | ||
uci set network.ffuplink.device=ffuplink | ||
uci set network.ffuplink.peerdns=0 | ||
# see https://github.com/freifunk-berlin/firmware/issues/561 | ||
uci set network.ffuplink.ip4table=ffuplink | ||
uci set network.ffuplink.ip6table=ffuplink | ||
# the following options need to be set by the individual uplink-package | ||
uci set network.ffuplink.proto=none | ||
uci commit network.ffuplink | ||
uci -q delete network.ffuplink | ||
# create a very basic ffuplink interface | ||
uci set network.ffuplink=interface | ||
uci set network.ffuplink.device=ffuplink | ||
uci set network.ffuplink.peerdns=0 | ||
# see https://github.com/freifunk-berlin/firmware/issues/561 | ||
uci set network.ffuplink.ip4table=ffuplink | ||
uci set network.ffuplink.ip6table=ffuplink | ||
# the following options need to be set by the individual uplink-package | ||
uci set network.ffuplink.proto=none | ||
uci commit network.ffuplink | ||
|
||
guard_delete notunnel | ||
guard_delete tunnelberlin_openvpn | ||
guard_delete tunnelberlin_tunneldigger | ||
guard_delete vpn03_openvpn | ||
guard_delete notunnel | ||
guard_delete tunnelberlin_openvpn | ||
guard_delete tunnelberlin_tunneldigger | ||
guard_delete vpn03_openvpn | ||
} | ||
|
||
generate_random_mac_hex() { | ||
local prefix=$1 | ||
local prefix="$1" | ||
|
||
[ -n "$prefix" ] || return | ||
local macaddr | ||
# Create a static macaddr starting with "prefix" for ffuplink devices | ||
# See the website https://www.itwissen.info/MAC-Adresse-MAC-address.html | ||
for byte in 2 3 4 5 6; do | ||
macaddr=$macaddr`dd if=/dev/urandom bs=1 count=1 2> /dev/null | hexdump -e '1/1 ":%02x"'` | ||
done | ||
[ -n "$prefix" ] || return | ||
local macaddr | ||
# Create a static macaddr starting with "prefix" for ffuplink devices | ||
# See the website https://www.itwissen.info/MAC-Adresse-MAC-address.html | ||
for byte in 2 3 4 5 6; do | ||
macaddr=$macaddr$(dd if=/dev/urandom bs=1 count=1 2>/dev/null | hexdump -e '1/1 ":%02x"') | ||
done | ||
|
||
echo $prefix$macaddr | ||
echo "$prefix$macaddr" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.