wireguard: converted whitespaces from space to tab

With this change, the file is reduced from 5186 bytes to 4649 bytes that
its approximately 10.5 percent less memory consumption. For small
devices, sometimes every byte counts.
Also, all other protocol handler use tabs instead of spaces.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2019-04-09 10:52:03 +02:00 committed by Hans Dedecker
parent c8a8294f6e
commit 78b6931a1a

View File

@ -2,21 +2,18 @@
# Copyright 2016-2017 Dan Luedtke <mail@danrl.com> # Copyright 2016-2017 Dan Luedtke <mail@danrl.com>
# Licensed to the public under the Apache License 2.0. # Licensed to the public under the Apache License 2.0.
WG=/usr/bin/wg WG=/usr/bin/wg
if [ ! -x $WG ]; then if [ ! -x $WG ]; then
logger -t "wireguard" "error: missing wireguard-tools (${WG})" logger -t "wireguard" "error: missing wireguard-tools (${WG})"
exit 0 exit 0
fi fi
[ -n "$INCLUDE_ONLY" ] || { [ -n "$INCLUDE_ONLY" ] || {
. /lib/functions.sh . /lib/functions.sh
. ../netifd-proto.sh . ../netifd-proto.sh
init_proto "$@" init_proto "$@"
} }
proto_wireguard_init_config() { proto_wireguard_init_config() {
proto_config_add_string "private_key" proto_config_add_string "private_key"
proto_config_add_int "listen_port" proto_config_add_int "listen_port"
@ -26,7 +23,6 @@ proto_wireguard_init_config() {
no_proto_task=1 no_proto_task=1
} }
proto_wireguard_setup_peer() { proto_wireguard_setup_peer() {
local peer_config="$1" local peer_config="$1"
@ -96,7 +92,6 @@ proto_wireguard_setup_peer() {
fi fi
} }
proto_wireguard_setup() { proto_wireguard_setup() {
local config="$1" local config="$1"
local wg_dir="/tmp/wireguard" local wg_dir="/tmp/wireguard"
@ -189,13 +184,11 @@ proto_wireguard_setup() {
proto_send_update "${config}" proto_send_update "${config}"
} }
proto_wireguard_teardown() { proto_wireguard_teardown() {
local config="$1" local config="$1"
ip link del dev "${config}" >/dev/null 2>&1 ip link del dev "${config}" >/dev/null 2>&1
} }
[ -n "$INCLUDE_ONLY" ] || { [ -n "$INCLUDE_ONLY" ] || {
add_protocol wireguard add_protocol wireguard
} }