summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2013-01-03 16:16:25 +0100
committerJouke Witteveen <j.witteveen@gmail.com>2013-01-03 16:16:25 +0100
commit6539dfe0df5c19e8acb8fe251b46098a25719cbc (patch)
tree72a2e189ca588b4d3878db73cb7171063287d35e /src/lib
parentfafa6603f87d68fd6b30dcfd4600cb1006e02a9e (diff)
downloadnetctl-6539dfe0df5c19e8acb8fe251b46098a25719cbc.tar.gz
netctl-6539dfe0df5c19e8acb8fe251b46098a25719cbc.tar.xz
Indentation fixes
This settles a style for 'case' statements: The label and closing colons are indented with two spaces, The body is indented with two more, totalling four spaces.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/8021x12
-rwxr-xr-xsrc/lib/auto.action8
-rw-r--r--src/lib/globals10
-rw-r--r--src/lib/ip32
-rwxr-xr-xsrc/lib/network20
5 files changed, 41 insertions, 41 deletions
diff --git a/src/lib/8021x b/src/lib/8021x
index 1cd4343..fa23dd3 100644
--- a/src/lib/8021x
+++ b/src/lib/8021x
@@ -200,27 +200,27 @@ wpa_make_config_block() {
echo "ssid=$(wpa_quote "$ESSID")"
[[ $AP ]] && echo "bssid=${AP,,}"
is_yes "${AdHoc:-no}" && echo "mode=1"
- ;;
+ ;;
wpa-configsection)
printf "%s\n" "${WPAConfigSection[@]}"
return
- ;;
+ ;;
*)
report_error "Unsupported security setting: '$Security'"
return 1
- ;;
+ ;;
esac
# Key management
case $Security in
none)
echo "key_mgmt=NONE"
- ;;
+ ;;
wep)
echo "key_mgmt=NONE"
echo "wep_tx_keyidx=0"
echo "wep_key0=$(wpa_quote "$Key")"
- ;;
+ ;;
wpa)
echo "proto=RSN WPA"
if [[ "${#Key}" -eq 64 ]]; then
@@ -228,7 +228,7 @@ wpa_make_config_block() {
else
echo "psk=$(wpa_quote "$Key")"
fi
- ;;
+ ;;
esac
# Hidden SSID
diff --git a/src/lib/auto.action b/src/lib/auto.action
index bdbb9ad..ae49384 100755
--- a/src/lib/auto.action
+++ b/src/lib/auto.action
@@ -31,7 +31,7 @@ case $action in
netctl-auto stop "$interface"
exit 1
fi
- ;;
+ ;;
DISCONNECT)
if [[ -z $profile ]]; then
dhcpcd -k "$interface"
@@ -42,15 +42,15 @@ case $action in
exit 1
fi
ip_unset && rm -f "$PROFILE_FILE"
- ;;
+ ;;
LOST|REESTABLISHED)
# Not handled.
exit 0
- ;;
+ ;;
*)
# ???
exit 1
- ;;
+ ;;
esac
diff --git a/src/lib/globals b/src/lib/globals
index 8277a40..51acb0d 100644
--- a/src/lib/globals
+++ b/src/lib/globals
@@ -45,14 +45,14 @@ is_yes() {
case ${1,,} in
yes|true|on|1)
return 0
- ;;
+ ;;
no|false|off|0)
return 1
- ;;
+ ;;
*)
report_error "Not a valid truth value: '$1'"
return 1
- ;;
+ ;;
esac
}
@@ -61,8 +61,8 @@ is_yes() {
## Show what we evaluate when debugging, but always evaluate
do_debug() {
- report_debug "${FUNCNAME[1]}:" "$@"
- "$@"
+ report_debug "${FUNCNAME[1]}:" "$@"
+ "$@"
}
## Exit if we are not effectively root
diff --git a/src/lib/ip b/src/lib/ip
index 02d99f4..f2f787d 100644
--- a/src/lib/ip
+++ b/src/lib/ip
@@ -36,20 +36,20 @@ ip_set() {
report_error "DHCP IP lease attempt failed on interface '$Interface'"
return 1
fi
- ;;
+ ;;
dhclient)
rm -f "/run/dhclient-${Interface}.pid"
if ! do_debug dhclient -q -e "TIMEOUT=${TimeoutDHCP:-10}" -pf "/run/dhclient-$Interface.pid" $DhclientOptions "$Interface"; then
report_error "DHCP IP lease attempt failed on interface '$Interface'"
return 1
fi
- ;;
+ ;;
*)
report_error "Unsupported DHCP client: '$DHCPClient'"
return 1
- ;;
+ ;;
esac
- ;;
+ ;;
static)
if [[ $Address ]]; then
for addr in "${Address[@]}"; do
@@ -66,13 +66,13 @@ ip_set() {
return 1
fi
fi
- ;;
+ ;;
""|no)
- ;;
+ ;;
*)
report_error "IP must be either 'dhcp', 'static' or 'no'"
return 1
- ;;
+ ;;
esac
# Add static IP routes
@@ -89,16 +89,16 @@ ip_set() {
case "$IP6" in
dhcp*|stateless|static)
[[ -d "/proc/sys/net/ipv6" ]] || modprobe ipv6
- ;;
+ ;;
no)
[[ -d "/proc/sys/net/ipv6" ]] && sysctl -q -w "net.ipv6.conf.$interface_sysctl.accept_ra=0"
- ;;
+ ;;
"") # undefined IP6 does not prevent RA's from being received -> nop
- ;;
+ ;;
*)
report_error "IP6 must be 'dhcp', 'dhcp-noaddr', 'stateless', 'static' or 'no'"
return 1
- ;;
+ ;;
esac
case "$IP6" in
@@ -114,10 +114,10 @@ ip_set() {
report_error "DHCPv6 IP lease attempt failed on interface '$Interface'"
return 1
fi
- ;;
+ ;;
stateless)
sysctl -q -w "net.ipv6.conf.$interface_sysctl.accept_ra=1"
- ;;
+ ;;
static)
sysctl -q -w "net.ipv6.conf.$interface_sysctl.accept_ra=0"
if [[ -n $Address6 ]]; then
@@ -127,7 +127,7 @@ ip_set() {
fi
done
fi
- ;;
+ ;;
esac
if [[ $IP6 ]]; then
@@ -193,13 +193,13 @@ ip_unset() {
if [[ -f "/run/dhcpcd-$Interface.pid" ]]; then
do_debug dhcpcd -qk "$Interface" >/dev/null
fi
- ;;
+ ;;
dhclient)
if [[ -f "/run/dhclient-$Interface.pid" ]]; then
# Alternatively, use -r instead of -x to also release the lease
do_debug dhclient -q -x "$Interface" -pf "/run/dhclient-$Interface.pid" >/dev/null
fi
- ;;
+ ;;
esac
fi
if [[ "$IP6" == dhcp* ]]; then
diff --git a/src/lib/network b/src/lib/network
index 1117737..bc11da7 100755
--- a/src/lib/network
+++ b/src/lib/network
@@ -22,19 +22,19 @@ interface_is_up() {
## Activate an interface
# $1: interface name
bring_interface_up() {
- local interface=$1
- ip link set dev "$interface" up &>/dev/null
- timeout_wait "${TimeoutUp:-5}" 'interface_is_up "$interface"'
+ local interface=$1
+ ip link set dev "$interface" up &>/dev/null
+ timeout_wait "${TimeoutUp:-5}" 'interface_is_up "$interface"'
}
## Deactivate an interface
# $1: interface name
bring_interface_down() {
- local interface=$1
- ip addr flush dev "$interface" &>/dev/null
- ip link set dev "$interface" down &>/dev/null
- # We reuse the up timeout (down normally is faster)
- timeout_wait "${TimeoutUp:-5}" '! interface_is_up "$interface"'
+ local interface=$1
+ ip addr flush dev "$interface" &>/dev/null
+ ip link set dev "$interface" down &>/dev/null
+ # We reuse the up timeout (down normally is faster)
+ timeout_wait "${TimeoutUp:-5}" '! interface_is_up "$interface"'
}
@@ -69,7 +69,7 @@ case $1 in
exit 1
fi
report_notice "Started network profile '$Profile'"
- ;;
+ ;;
stop)
report_notice "Stopping network profile '$Profile'..."
# JP: sandbox the eval
@@ -88,7 +88,7 @@ case $1 in
exit 1
fi
report_notice "Stopped network profile '$Profile'"
- ;;
+ ;;
esac