]> git.ipfire.org Git - people/ms/network.git/commitdiff
Remove the function keyword which is a bashism
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 2 May 2015 16:06:07 +0000 (16:06 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 2 May 2015 16:06:07 +0000 (16:06 +0000)
77 files changed:
src/bash-completion/network
src/functions/functions.aiccu
src/functions/functions.batman-adv
src/functions/functions.bonding
src/functions/functions.bridge
src/functions/functions.cli
src/functions/functions.cli.firewall
src/functions/functions.config
src/functions/functions.conntrack
src/functions/functions.db
src/functions/functions.device
src/functions/functions.dhcpd
src/functions/functions.dns
src/functions/functions.dummy
src/functions/functions.firewall
src/functions/functions.firewall-policy
src/functions/functions.firewall-zones
src/functions/functions.he
src/functions/functions.hook
src/functions/functions.hostapd
src/functions/functions.hotplug
src/functions/functions.http
src/functions/functions.in
src/functions/functions.ip
src/functions/functions.ip-tunnel
src/functions/functions.iptables
src/functions/functions.ipv4
src/functions/functions.ipv6
src/functions/functions.list
src/functions/functions.lock
src/functions/functions.logging
src/functions/functions.macros
src/functions/functions.modem
src/functions/functions.phy
src/functions/functions.ports
src/functions/functions.ppp
src/functions/functions.pppoe-server
src/functions/functions.radvd
src/functions/functions.route
src/functions/functions.routing
src/functions/functions.serial
src/functions/functions.service
src/functions/functions.settings
src/functions/functions.stp
src/functions/functions.sysctl
src/functions/functions.usb
src/functions/functions.util
src/functions/functions.vlan
src/functions/functions.wireless
src/functions/functions.wpa_supplicant
src/functions/functions.zone
src/header-port
src/header-zone
src/helpers/pppd-angel
src/hooks/configs/ipv4-dhcp
src/hooks/configs/ipv4-static
src/hooks/configs/ipv6-auto
src/hooks/configs/ipv6-dhcp
src/hooks/configs/ipv6-static
src/hooks/configs/pppoe-server
src/hooks/ports/batman-adv
src/hooks/ports/bonding
src/hooks/ports/dummy
src/hooks/ports/ethernet
src/hooks/ports/vlan
src/hooks/ports/wireless-adhoc
src/hooks/ports/wireless-ap
src/hooks/zones/6rd
src/hooks/zones/6to4-tunnel
src/hooks/zones/aiccu
src/hooks/zones/bridge
src/hooks/zones/modem
src/hooks/zones/pppoe
src/hooks/zones/wireless
src/network
src/ppp/dialer
src/udev/network-hotplug-rename

index 143295c8131fdade48d76924340cde6ebbc64ba5..a95490dcb116b5a3fc42c857f611b814f15db797 100644 (file)
@@ -20,7 +20,7 @@
 ###############################################################################
 # network(8) completion
 
-function _network_find_on_cmdline () {
+_network_find_on_cmdline () {
        local word subcommand c=0
        while [ ${c} -lt ${cword} ]; do
                word="${words[c]}"
@@ -34,21 +34,21 @@ function _network_find_on_cmdline () {
        done
 }
 
-function _network_complete_hooks() {
+_network_complete_hooks() {
        local type="${1}"
 
        COMPREPLY=( $(compgen -W "$(network raw list-hooks "${type}")" -- "${cur}") )
 }
 
-function _network_complete_ports() {
+_network_complete_ports() {
        COMPREPLY=( $(compgen -W "$(network raw list-ports)" -- "${cur}") )
 }
 
-function _network_complete_zones() {
+_network_complete_zones() {
        COMPREPLY=( $(compgen -W "$(network raw list-zones)" -- "${cur}") )
 }
 
-function _network_device() {
+_network_device() {
        local words=( $@ )
 
        local commands="list $(network raw list-devices)"
@@ -69,7 +69,7 @@ function _network_device() {
        esac
 }
 
-function _network_device_subcommand() {
+_network_device_subcommand() {
        local words=( $@ )
 
        local commands="discover monitor status unlock ussd"
@@ -86,7 +86,7 @@ function _network_device_subcommand() {
        esac
 }
 
-function _network_dhcpd() {
+_network_dhcpd() {
        local proto="${1}"
        shift
 
@@ -107,7 +107,7 @@ function _network_dhcpd() {
        esac
 }
 
-function _network_dhcpd_subnet() {
+_network_dhcpd_subnet() {
        local proto="${1}"
        shift
 
@@ -135,7 +135,7 @@ function _network_dhcpd_subnet() {
        esac
 }
 
-function _network_dhcpd_subnet_subcommand() {
+_network_dhcpd_subnet_subcommand() {
        local proto="${1}"
        local subnet="${2}"
        shift 2
@@ -163,7 +163,7 @@ function _network_dhcpd_subnet_subcommand() {
        esac
 }
 
-function _network_dhcpd_subnet_subcommand_options() {
+_network_dhcpd_subnet_subcommand_options() {
        local proto="${1}"
        local subnet="${2}"
        shift 2
@@ -176,7 +176,7 @@ function _network_dhcpd_subnet_subcommand_options() {
        COMPREPLY=( $(compgen -W "${options}" -- "${cur}") )
 }
 
-function _network_dhcpd_subnet_subcommand_range() {
+_network_dhcpd_subnet_subcommand_range() {
        local proto="${1}"
        local subnet="${2}"
        shift 2
@@ -201,7 +201,7 @@ function _network_dhcpd_subnet_subcommand_range() {
        esac
 }
 
-function _network_dns_server() {
+_network_dns_server() {
        local words=( $@ )
 
        local commands="add list remove update"
@@ -219,7 +219,7 @@ function _network_dns_server() {
        esac
 }
 
-function _network_port() {
+_network_port() {
        local words=( $@ )
 
        local commands="new destroy $(network raw list-ports)"
@@ -244,7 +244,7 @@ function _network_port() {
        esac
 }
 
-function _network_port_subcommand() {
+_network_port_subcommand() {
        local words=( $@ )
 
        local commands="create down edit remove status up"
@@ -255,7 +255,7 @@ function _network_port_subcommand() {
        fi
 }
 
-function _network_route() {
+_network_route() {
        local words=( $@ )
 
        local commands="add list remove"
@@ -279,7 +279,7 @@ function _network_route() {
        esac
 }
 
-function _network_settings() {
+_network_settings() {
        local words=( $@ )
 
        local key keys
@@ -289,7 +289,7 @@ function _network_settings() {
        COMPREPLY=( $(compgen -W "${keys}" -- "${cur}") )
 }
 
-function _network_zone() {
+_network_zone() {
        local words=( $@ )
 
        local commands="new destroy $(network raw list-zones)"
@@ -316,7 +316,7 @@ function _network_zone() {
        esac
 }
 
-function _network_zone_subcommand() {
+_network_zone_subcommand() {
        local zone="${1}"
        shift
 
@@ -340,7 +340,7 @@ function _network_zone_subcommand() {
        esac
 }
 
-function _network_zone_subcommand_port() {
+_network_zone_subcommand_port() {
        local zone="${1}"
        shift
 
@@ -370,7 +370,7 @@ function _network_zone_subcommand_port() {
        esac
 }
 
-function _network_zone_subcommand_port_subcommand() {
+_network_zone_subcommand_port_subcommand() {
        local zone="${1}"
        local port="${2}"
        shift 2
@@ -391,7 +391,7 @@ function _network_zone_subcommand_port_subcommand() {
        esac
 }
 
-function _network() {
+_network() {
        local cur prev words cword
        _init_completion || return
 
index f08bb6883f61245cd8988213bb24ee394ac0bfb1..a247503e2ae1eaeaeac2ce2ae4eaf4cf14301df1 100644 (file)
@@ -22,7 +22,7 @@
 # Define protocols which are supported by aiccu.
 AICCU_SUPPORTED_PROTOCOLS="tic tsp l2tp"
 
-function aiccu_start() {
+aiccu_start() {
        local device=${1}
        assert isset device
 
@@ -40,7 +40,7 @@ function aiccu_start() {
        return ${EXIT_OK}
 }
 
-function aiccu_stop() {
+aiccu_stop() {
        local device=${1}
        assert isset device
 
@@ -48,7 +48,7 @@ function aiccu_stop() {
        service_stop "aiccu@${device}.service"
 }
 
-function aiccu_write_config() {
+aiccu_write_config() {
        local device=${1}
        local file=${2}
        shift 2
index 23ed6119b8e1df2aad5c7dc92ade73f5906d926a..9fe74fd8704e57a9c657ac7661e2774db6abe999 100644 (file)
 #                                                                             #
 ###############################################################################
 
-function batman_adv_start() {
+batman_adv_start() {
        # Load the batman kernel module.
        module_load "batman-adv"
 }
 
-function batman_adv_add() {
+batman_adv_add() {
        local device="${1}"
        assert isset device
 
@@ -41,14 +41,14 @@ function batman_adv_add() {
        return ${ret}
 }
 
-function batman_adv_delete() {
+batman_adv_delete() {
        local device="${1}"
        assert isset device
 
        device_delete "${device}"
 }
 
-function batman_adv_attach() {
+batman_adv_attach() {
        local device=${1}
        assert isset device
 
@@ -61,14 +61,14 @@ function batman_adv_attach() {
        fwrite "${SYS_CLASS_NET}/${port}/batman_adv/mesh_iface" "${device}"
 }
 
-function batman_adv_detach() {
+batman_adv_detach() {
        local port=${1}
        assert isset port
 
        fwrite "${SYS_CLASS_NET}/${port}/batman_adv/mesh_iface" "none"
 }
 
-function batman_adv_get_aggregated_ogms() {
+batman_adv_get_aggregated_ogms() {
        local device=${1}
        assert isset device
 
@@ -85,7 +85,7 @@ function batman_adv_get_aggregated_ogms() {
        return ${EXIT_ERROR}
 }
 
-function batman_adv_get_ap_isolation() {
+batman_adv_get_ap_isolation() {
        local device=${1}
        assert isset device
 
@@ -102,7 +102,7 @@ function batman_adv_get_ap_isolation() {
        return ${EXIT_ERROR}
 }
 
-function batman_adv_get_bonding_mode() {
+batman_adv_get_bonding_mode() {
        local device=${1}
        assert isset device
 
@@ -119,7 +119,7 @@ function batman_adv_get_bonding_mode() {
        return ${EXIT_ERROR}
 }
 
-function batman_adv_get_distributed_arp_table() {
+batman_adv_get_distributed_arp_table() {
        local device=${1}
        assert isset device
 
@@ -136,7 +136,7 @@ function batman_adv_get_distributed_arp_table() {
        return ${EXIT_ERROR}
 }
 
-function batman_adv_get_bridge_loop_avoidance() {
+batman_adv_get_bridge_loop_avoidance() {
        local device=${1}
        assert isset device
 
@@ -153,7 +153,7 @@ function batman_adv_get_bridge_loop_avoidance() {
        return ${EXIT_ERROR}
 }
 
-function batman_adv_get_fragmentation() {
+batman_adv_get_fragmentation() {
        local device=${1}
        assert isset device
 
@@ -170,7 +170,7 @@ function batman_adv_get_fragmentation() {
        return ${EXIT_ERROR}
 }
 
-function batman_adv_get_gateway_mode() {
+batman_adv_get_gateway_mode() {
        local device=${1}
        assert isset device
 
@@ -187,35 +187,35 @@ function batman_adv_get_gateway_mode() {
        return ${EXIT_ERROR}
 }
 
-function batman_adv_get_gateway_bandwidth() {
+batman_adv_get_gateway_bandwidth() {
        local device=${1}
        assert isset device
 
        fread "${SYS_CLASS_NET}/${device}/mesh/gw_bandwidth"
 }
 
-function batman_adv_get_gateway_selection_class() {
+batman_adv_get_gateway_selection_class() {
        local device=${1}
        assert isset device
 
        fread "${SYS_CLASS_NET}/${device}/mesh/gw_sel_class"
 }
 
-function batman_adv_get_hop_penalty() {
+batman_adv_get_hop_penalty() {
        local device=${1}
        assert isset device
 
        fread "${SYS_CLASS_NET}/${device}/mesh/hop_penalty"
 }
 
-function batman_adv_get_originator_interval() {
+batman_adv_get_originator_interval() {
        local device=${1}
        assert isset device
 
        fread "${SYS_CLASS_NET}/${device}/mesh/orig_interval"
 }
 
-function batman_adv_get_routing_algorithm() {
+batman_adv_get_routing_algorithm() {
        local device=${1}
        assert isset device
 
index 495ad3073d1b5233454e5a0cd2203ef09bebdedf..d9861e58cb4a802779ff997df49d15832ca3f737 100644 (file)
@@ -23,11 +23,11 @@ BONDING_ALLOWED_MODES="balance-rr active-backup balance-xor broadcast 802.3ad \
        balance-tlb balance-alb"
 BONDING_MASTERS="/sys/class/net/bonding_masters"
 
-function bonding_init() {
+bonding_init() {
        module_load "bonding"
 }
 
-function bonding_create() {
+bonding_create() {
        local device=${1}
        assert isset device
        shift
@@ -89,7 +89,7 @@ function bonding_create() {
        return ${EXIT_OK}
 }
 
-function bonding_remove() {
+bonding_remove() {
        local device=${1}
        assert isset device
 
@@ -114,7 +114,7 @@ function bonding_remove() {
        return ${EXIT_OK}
 }
 
-function bonding_get_mode() {
+bonding_get_mode() {
        local device=${1}
        assert isset device
 
@@ -123,7 +123,7 @@ function bonding_get_mode() {
        print "${mode}"
 }
 
-function bonding_set_mode() {
+bonding_set_mode() {
        assert [ $# -eq 2 ]
 
        local device="${1}"
@@ -139,7 +139,7 @@ function bonding_set_mode() {
        return ${EXIT_OK}
 }
 
-function bonding_enslave_device() {
+bonding_enslave_device() {
        local device=${1}
        assert isset device
 
@@ -170,7 +170,7 @@ function bonding_enslave_device() {
        return ${EXIT_OK}
 }
 
-function bonding_get_slaves() {
+bonding_get_slaves() {
        local device=${1}
        assert isset device
        shift
@@ -194,7 +194,7 @@ function bonding_get_slaves() {
        return ${EXIT_OK}
 }
 
-function bonding_get_lacp_rate() {
+bonding_get_lacp_rate() {
        local device=${1}
        assert isset device
 
@@ -206,14 +206,14 @@ function bonding_get_lacp_rate() {
        return ${EXIT_OK}
 }
 
-function bonding_get_miimon() {
+bonding_get_miimon() {
        local device=${1}
        assert isset device
 
        fread ${SYS_CLASS_NET}/${device}/bonding/miimon
 }
 
-function bonding_set_miimon() {
+bonding_set_miimon() {
        local device=${1}
        assert isset device
 
@@ -223,7 +223,7 @@ function bonding_set_miimon() {
        print "${miimon}" > ${SYS_CLASS_NET}/${device}/bonding/miimon
 }
 
-function bonding_slave_get_master() {
+bonding_slave_get_master() {
        local slave=${1}
        assert isset slave
 
index 3f14e3879a6c6bea88569f85e95f064c83d5f849..46ca80c2b63f66357dd617c417001408bd5a4431 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function bridge_create() {
+bridge_create() {
        local bridge=${1}
        assert isset bridge
        shift
@@ -77,14 +77,14 @@ function bridge_create() {
        return ${ret}
 }
 
-function bridge_delete() {
+bridge_delete() {
        local bridge=${1}
        assert isset bridge
 
        device_delete ${bridge}
 }
 
-function bridge_attach_device() {
+bridge_attach_device() {
        local bridge=${1}
        assert isset bridge
 
@@ -125,7 +125,7 @@ function bridge_attach_device() {
        return ${ret}
 }
 
-function bridge_detach_device() {
+bridge_detach_device() {
        local bridge=${1}
        assert isset bridge
 
@@ -161,7 +161,7 @@ function bridge_detach_device() {
        return ${ret}
 }
 
-function bridge_get_members() {
+bridge_get_members() {
        local bridge=${1}
 
        assert isset bridge
@@ -175,7 +175,7 @@ function bridge_get_members() {
        done
 }
 
-function bridge_is_forwarding() {
+bridge_is_forwarding() {
        local seconds=45
        local zone=${1}
 
@@ -196,7 +196,7 @@ function bridge_is_forwarding() {
        return ${EXIT_ERROR}
 }
 
-function bridge_has_carrier() {
+bridge_has_carrier() {
        local zone=${1}
 
        local has_carrier=${EXIT_ERROR}
index a3ee722b113ba38f18b7a959cdab225d34183dca..15b5efad97d56f981c065b5c990869a22d18b73e 100644 (file)
@@ -21,7 +21,7 @@
 
 IDENT="  "
 
-function cli_help_requested() {
+cli_help_requested() {
        local argument="${1}"
 
        if [ -n "${argument}" ]; then
@@ -33,14 +33,14 @@ function cli_help_requested() {
        return ${EXIT_FALSE}
 }
 
-function cli_run_help() {
+cli_run_help() {
        local command="$@"
 
        print "Run \"${command} help\" to get more information."
        return ${EXIT_OK}
 }
 
-function cli_device_headline() {
+cli_device_headline() {
        local device=${1}
        assert isset device
 
@@ -140,7 +140,7 @@ function cli_device_headline() {
        fi
 }
 
-function cli_device_stats() {
+cli_device_stats() {
        local level=${1}
        local device=${2}
 
@@ -166,7 +166,7 @@ function cli_device_stats() {
        cli_space
 }
 
-function cli_device_vlan() {
+cli_device_vlan() {
        local device=${1}
 
        cli_headline 2 "VLAN"
@@ -176,7 +176,7 @@ function cli_device_vlan() {
        cli_space
 }
 
-function cli_device_bonded() {
+cli_device_bonded() {
        local device=${1}
 
        cli_headline 2 "Bonding information"
@@ -197,7 +197,7 @@ function cli_device_bonded() {
        cli_space
 }
 
-function cli_device_bonding() {
+cli_device_bonding() {
        local device=${1}
        assert isset device
 
@@ -242,7 +242,7 @@ function cli_device_bonding() {
        cli_space
 }
 
-function cli_headline() {
+cli_headline() {
        local level=${1}
        local format=${2}
        shift 2
@@ -254,7 +254,7 @@ function cli_headline() {
        printf "${out}"
 }
 
-function cli_statusline() {
+cli_statusline() {
        local level=${1}
        shift
 
@@ -264,7 +264,7 @@ function cli_statusline() {
        cli_print $(( ${level} - 1 )) "%-12s %s" "${head}" "$@"
 }
 
-function cli_print() {
+cli_print() {
        local level=${1}
        local format=${2}
        shift 2
@@ -276,7 +276,7 @@ function cli_print() {
        printf "${out}"
 }
 
-function cli_print_fmt1() {
+cli_print_fmt1() {
        local level=${1}
        shift
 
@@ -286,7 +286,7 @@ function cli_print_fmt1() {
        cli_print ${level} "${format}" "$@"
 }
 
-function cli_print_bool() {
+cli_print_bool() {
        if [ "${1}" = "${EXIT_TRUE}" ]; then
                echo "true"
        else
@@ -294,7 +294,7 @@ function cli_print_bool() {
        fi
 }
 
-function cli_print_yesno() {
+cli_print_yesno() {
        if [ "${1}" = "${EXIT_TRUE}" ]; then
                echo "yes"
        else
@@ -302,24 +302,24 @@ function cli_print_yesno() {
        fi
 }
 
-function cli_print_enabled() {
+cli_print_enabled() {
        enabled ${1}
 
        cli_print_bool $?
 }
 
-function cli_print_warning() {
+cli_print_warning() {
        local level=${1}
        shift
 
        cli_print ${level} "${CLR_YELLOW_B}%s${CLR_RESET}" "$@"
 }
 
-function cli_space() {
+cli_space() {
        printf "\n"
 }
 
-function cli_ident() {
+cli_ident() {
        local level=${1}
        assert isinteger level
 
@@ -332,7 +332,7 @@ function cli_ident() {
        print "${ident}"
 }
 
-function cli_yesno() {
+cli_yesno() {
        local message="$@ [y/n] "
        local yesno
 
@@ -351,16 +351,16 @@ function cli_yesno() {
        done
 }
 
-function cli_get_key() {
+cli_get_key() {
        local key="${1%%=*}"
        echo "${key/--/}"
 }
 
-function cli_get_val() {
+cli_get_val() {
        echo "${@#*=}"
 }
 
-function cli_get_bool() {
+cli_get_bool() {
        local value="$(cli_get_val "$@")"
 
        if enabled value; then
@@ -372,7 +372,7 @@ function cli_get_bool() {
        return ${EXIT_FALSE}
 }
 
-function cli_usage() {
+cli_usage() {
        local command="$@"
        local basename="$(basename ${0})"
 
@@ -384,7 +384,7 @@ function cli_usage() {
        echo "Please run '${command}' for detailed help." >&2
 }
 
-function cli_show_man() {
+cli_show_man() {
        local manpage=${1}
        assert isset manpage
 
index 9e99f31acd389024cfce463cc512b477cf27bac3..ffd3a657d713641972e2562057e6f96181026e6d 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function firewall_cli() {
+firewall_cli() {
        local protocol="${1}"
        assert isset protocol
        shift
@@ -76,7 +76,7 @@ function firewall_cli() {
        exit ${EXIT_OK}
 }
 
-function firewall_cli_panic() {
+firewall_cli_panic() {
        local protocol="${1}"
        assert isset protocol
        shift
@@ -103,7 +103,7 @@ function firewall_cli_panic() {
        firewall_panic ${admin_hosts}
 }
 
-function firewall_cli_settings() {
+firewall_cli_settings() {
        if cli_help_requested $@; then
                cli_show_man firewall-settings
                exit ${EXIT_OK}
@@ -117,7 +117,7 @@ function firewall_cli_settings() {
        fi
 }
 
-function firewall_cli_zone() {
+firewall_cli_zone() {
        local protocol="${1}"
        assert isset protocol
        shift 
@@ -183,7 +183,7 @@ function firewall_cli_zone() {
 }
 
 # Show firewall zone conifguration.
-function firewall_cli_zone_status() {
+firewall_cli_zone_status() {
        local zone=${1}
        assert isset zone
 
@@ -200,7 +200,7 @@ function firewall_cli_zone_status() {
 }
 
 # Edit firewall zone configuration.
-function firewall_cli_zone_edit() {
+firewall_cli_zone_edit() {
        firewall_zone_edit "$@"
 
        exit ${EXIT_OK}
index ab1dadc4a2ab513c3293d2bf33879b3d59578aa2..854f4907fcdb24f1bdcc1c09454f62183db0414f 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function config_header() {
+config_header() {
        local what=${1}
        assert isset what
 
@@ -34,7 +34,7 @@ function config_header() {
        echo
 }
 
-function config_hostname() {
+config_hostname() {
        local hostname=${1}
 
        if [ -n "${hostname}" ]; then
@@ -44,7 +44,7 @@ function config_hostname() {
        fi
 }
 
-function config_domainname() {
+config_domainname() {
        local hostname=$(config_hostname)
 
        # Strip off the hostname part and just return
index aa432efa5334c51c4d6b2b6666f4c5064e08548d..e4d1d4449619cc387b709673dd5c2b63cf80de70 100644 (file)
 
 # Accounting
 
-function conntrack_get_accounting() {
+conntrack_get_accounting() {
        sysctl_get "net.netfilter.nf_conntrack_acct"
 }
 
-function conntrack_set_accounting() {
+conntrack_set_accounting() {
        local value="${1}"
        assert isset value
 
@@ -43,11 +43,11 @@ function conntrack_set_accounting() {
 
 # Max. connections
 
-function conntrack_get_max_connections() {
+conntrack_get_max_connections() {
        sysctl_get "net.netfilter.nf_conntrack_max"
 }
 
-function conntrack_set_max_connections() {
+conntrack_set_max_connections() {
        local value="${1}"
        assert isinteger value
 
@@ -57,11 +57,11 @@ function conntrack_set_max_connections() {
 
 # UDP timeout
 
-function conntrack_get_udp_timeout() {
+conntrack_get_udp_timeout() {
        sysctl_get "net.netfilter.nf_conntrack_udp_timeout"
 }
 
-function conntrack_set_udp_timeout() {
+conntrack_set_udp_timeout() {
        local value="${1}"
        assert isinteger value
 
index 23e0e359adcd57a9f2832ebc23b019eb5fabad7b..251832cf46c463ea82672381e1ba4b064b3d021a 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function db_connection_init() {
+db_connection_init() {
        if [ -e "${DB_CONNECTION_FILE}" ]; then
                return ${EXIT_OK}
        fi
@@ -40,7 +40,7 @@ CREATE VIEW current as
 EOF
 }
 
-function db_connection_update() {
+db_connection_update() {
        local zone=${1}
        local action=${2}
        shift 2
@@ -55,7 +55,7 @@ INSERT INTO log(zone, time, state)
 EOF
 }
 
-function db_ppp_init() {
+db_ppp_init() {
        local file=${1}
 
        if [ -e "${file}" ]; then
@@ -75,7 +75,7 @@ CREATE TABLE accounting(
 EOF
 } 
 
-function db_ppp_update() {
+db_ppp_update() {
        local zone=${1}
        shift
 
index 8252991dff158bb0ce48b1205cf16d70d4763fec..d5ff381d4ce6dcf514f6807ae1e0093ccdc098eb 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function device_list() {
+device_list() {
        local devices
 
        # Add all interfaces
@@ -36,7 +36,7 @@ function device_list() {
 }
 
 # Check if the device exists
-function device_exists() {
+device_exists() {
        local device=${1}
 
        # If device name was not found, exit.
@@ -54,7 +54,7 @@ function device_exists() {
        serial_exists ${device}
 }
 
-function device_matches_pattern() {
+device_matches_pattern() {
        local device="${1}"
        assert isset device
 
@@ -67,7 +67,7 @@ function device_matches_pattern() {
                && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
 
-function device_delete() {
+device_delete() {
        local device=${1}
        assert isset device
 
@@ -86,7 +86,7 @@ function device_delete() {
        return ${ret}
 }
 
-function device_has_flag() {
+device_has_flag() {
        local device=${1}
        local flag=${2}
 
@@ -100,7 +100,7 @@ function device_has_flag() {
 }
 
 # Check if the device is up
-function device_is_up() {
+device_is_up() {
        local device=${1}
 
        device_exists ${device} || return ${EXIT_ERROR}
@@ -108,7 +108,7 @@ function device_is_up() {
        device_has_flag ${device} 0x1
 }
 
-function device_ifindex_to_name() {
+device_ifindex_to_name() {
        local idx=${1}
        assert isset idx
 
@@ -128,7 +128,7 @@ function device_ifindex_to_name() {
        return ${EXIT_ERROR}
 }
 
-function device_get_ifindex() {
+device_get_ifindex() {
        local device=${1}
        assert isset device
 
@@ -141,12 +141,12 @@ function device_get_ifindex() {
 }
 
 # Check if the device is a batman-adv bridge
-function device_is_batman_adv() {
+device_is_batman_adv() {
        [ -d "${SYS_CLASS_NET}/${1}/mesh" ]
 }
 
 # Check if the device is a batman-adv slave port
-function device_is_batman_adv_slave() {
+device_is_batman_adv_slave() {
        local device="${1}"
 
        if [ -d "${SYS_CLASS_NET}/${device}/batman_adv" ]; then
@@ -166,28 +166,28 @@ function device_is_batman_adv_slave() {
 }
 
 # Check if the device is a bonding device
-function device_is_bonding() {
+device_is_bonding() {
        [ -d "/sys/class/net/${1}/bonding" ]
 }
 
 # Check if the device bonded in a bonding device
-function device_is_bonded() {
+device_is_bonded() {
        local device=${1}
 
        [ -d "${SYS_CLASS_NET}/${device}/bonding_slave" ]
 }
 
 # Check if the device is a bridge
-function device_is_bridge() {
+device_is_bridge() {
        [ -d "/sys/class/net/${1}/bridge" ]
 }
 
-function device_is_bridge_attached() {
+device_is_bridge_attached() {
        local device=${1}
        [ -d "${SYS_CLASS_NET}/${device}/brport" ]
 }
 
-function device_is_wireless_monitor() {
+device_is_wireless_monitor() {
        local device="${1}"
        assert isset device
 
@@ -195,7 +195,7 @@ function device_is_wireless_monitor() {
                device_matches_pattern "${device}" "${PORT_PATTERN_WIRELESS_MONITOR}"
 }
 
-function device_is_wireless_adhoc() {
+device_is_wireless_adhoc() {
        local device="${1}"
        assert isset device
 
@@ -203,7 +203,7 @@ function device_is_wireless_adhoc() {
                device_matches_pattern "${device}" "${PORT_PATTERN_WIRELESS_ADHOC}"
 }
 
-function device_get_bridge() {
+device_get_bridge() {
        local device=${1}
        assert isset device
 
@@ -220,7 +220,7 @@ function device_get_bridge() {
 }
 
 # Check if the device is a vlan device
-function device_is_vlan() {
+device_is_vlan() {
        local device=${1}
        assert isset device
 
@@ -228,7 +228,7 @@ function device_is_vlan() {
 }
 
 # Check if the device has vlan devices
-function device_has_vlans() {
+device_has_vlans() {
        local device=${1}
        assert isset device
 
@@ -240,7 +240,7 @@ function device_has_vlans() {
        [ -n "${vlans}" ] && return ${EXIT_OK} || return ${EXIT_ERROR}
 }
 
-function device_get_vlans() {
+device_get_vlans() {
        local device=${1}
        assert isset device
 
@@ -257,7 +257,7 @@ function device_get_vlans() {
 }
 
 # Check if the device is a ppp device
-function device_is_ppp() {
+device_is_ppp() {
        local device=${1}
 
        local type=$(__device_get_file ${device} type)
@@ -266,14 +266,14 @@ function device_is_ppp() {
 }
 
 # Check if the device is a pointopoint device.
-function device_is_ptp() {
+device_is_ptp() {
        local device=${1}
 
        device_has_flag ${device} 0x10
 }
 
 # Check if the device is a loopback device
-function device_is_loopback() {
+device_is_loopback() {
        local device=${1}
 
        [ "${device}" = "lo" ]
@@ -281,20 +281,20 @@ function device_is_loopback() {
 
 # Check if the device is a dummy device
 #  This is the worst possible check, but all I could come up with
-function device_is_dummy() {
+device_is_dummy() {
        local device="${1}"
 
        [[ ${device} =~ ^dummy[0-9]+$ ]]
 }
 
 # Check if the device is a wireless device
-function device_is_wireless() {
+device_is_wireless() {
        local device=${1}
 
        [ -d "${SYS_CLASS_NET}/${device}/phy80211" ]
 }
 
-function device_get_phy() {
+device_get_phy() {
        local device="${1}"
 
        if device_is_wireless "${device}"; then
@@ -305,16 +305,16 @@ function device_get_phy() {
        return ${EXIT_ERROR}
 }
 
-function device_is_phy() {
+device_is_phy() {
        phy_exists $@
 }
 
-function device_is_serial() {
+device_is_serial() {
        serial_exists $@
 }
 
 # Check if the device is a physical network interface
-function device_is_ethernet() {
+device_is_ethernet() {
        local device=${1}
 
        device_is_ethernet_compatible "${device}" || \
@@ -342,7 +342,7 @@ function device_is_ethernet() {
 }
 
 # Get the device type
-function device_get_type() {
+device_get_type() {
        local device=${1}
 
        # If the device does not exist (happens on udev remove events),
@@ -391,7 +391,7 @@ function device_get_type() {
        fi
 }
 
-function device_is_ethernet_compatible() {
+device_is_ethernet_compatible() {
        local device="${1}"
 
        # /sys/class/net/*/type must equal 1 for ethernet compatible devices
@@ -399,7 +399,7 @@ function device_is_ethernet_compatible() {
        [[ "${type}" = "1" ]]
 }
 
-function device_get_status() {
+device_get_status() {
        local device=${1}
        assert isset device
 
@@ -416,13 +416,13 @@ function device_get_status() {
        echo "${status}"
 }
 
-function device_get_address() {
+device_get_address() {
        local device=${1}
 
        cat ${SYS_CLASS_NET}/${device}/address 2>/dev/null
 }
 
-function device_set_address() {
+device_set_address() {
        assert [ $# -eq 2 ]
 
        local device="${1}"
@@ -461,7 +461,7 @@ function device_set_address() {
        return ${ret}
 }
 
-function device_get() {
+device_get() {
        local device
        local devices
 
@@ -478,12 +478,12 @@ function device_get() {
        return ${EXIT_OK}
 }
 
-function devices_get_all() {
+devices_get_all() {
        device_get
 }
 
 # Check if a device has a cable plugged in
-function device_has_carrier() {
+device_has_carrier() {
        local device=${1}
        assert isset device
 
@@ -491,13 +491,13 @@ function device_has_carrier() {
        [ "${carrier}" = "1" ]
 }
 
-function device_is_promisc() {
+device_is_promisc() {
        local device=${1}
 
        device_has_flag ${device} 0x200
 }
 
-function device_set_promisc() {
+device_set_promisc() {
        local device=${1}
        local state=${2}
 
@@ -509,12 +509,12 @@ function device_set_promisc() {
 }
 
 # Check if the device is free
-function device_is_free() {
+device_is_free() {
        ! device_is_used $@
 }
 
 # Check if the device is used
-function device_is_used() {
+device_is_used() {
        local device=${1}
 
        device_has_vlans ${device} && \
@@ -528,7 +528,7 @@ function device_is_used() {
 }
 
 # Give the device a new name
-function device_set_name() {
+device_set_name() {
        local source=$1
        local destination=${2}
 
@@ -551,7 +551,7 @@ function device_set_name() {
 }
 
 # Set device up
-function device_set_up() {
+device_set_up() {
        local device=${1}
 
        # Silently fail if device was not found
@@ -567,7 +567,7 @@ function device_set_up() {
        ip link set ${device} up
 }
 
-function device_set_parent_up() {
+device_set_parent_up() {
        local device=${1}
        local parent
 
@@ -586,7 +586,7 @@ function device_set_parent_up() {
 }
 
 # Set device down
-function device_set_down() {
+device_set_down() {
        local device=${1}
        assert isset device
 
@@ -604,7 +604,7 @@ function device_set_down() {
        return ${ret}
 }
 
-function device_set_parent_down() {
+device_set_parent_down() {
        local device=${1}
        local parent
 
@@ -623,7 +623,7 @@ function device_set_parent_down() {
        return ${EXIT_OK}
 }
 
-function device_get_mtu() {
+device_get_mtu() {
        local device=${1}
 
        if ! device_exists ${device}; then
@@ -635,7 +635,7 @@ function device_get_mtu() {
 }
 
 # Set mtu to a device
-function device_set_mtu() {
+device_set_mtu() {
        local device=${1}
        local mtu=${2}
 
@@ -673,7 +673,7 @@ function device_set_mtu() {
        return ${ret}
 }
 
-function device_adjust_mtu() {
+device_adjust_mtu() {
        assert [ $# -eq 2 ]
 
        local device="${1}"
@@ -683,7 +683,7 @@ function device_adjust_mtu() {
        device_set_mtu "${device}" "${mtu}"
 }
 
-function device_discover() {
+device_discover() {
        local device=${1}
 
        log INFO "Running discovery process on device '${device}'."
@@ -694,7 +694,7 @@ function device_discover() {
        done
 }
 
-function device_has_ip() {
+device_has_ip() {
        local device=${1}
        local addr=${2}
 
@@ -712,7 +712,7 @@ function device_has_ip() {
        listmatch ${addr} $(device_get_addresses ${device})
 }
 
-function device_get_addresses() {
+device_get_addresses() {
        local device=${1}
 
        assert device_exists ${device}
@@ -726,7 +726,7 @@ function device_get_addresses() {
                done
 }
 
-function __device_get_file() {
+__device_get_file() {
        local device=${1}
        local file=${2}
 
@@ -739,7 +739,7 @@ function __device_get_file() {
        echo "$(<${path})"
 }
 
-function __device_set_file() {
+__device_set_file() {
        assert [ $# -eq 3 ]
 
        local device="${1}"
@@ -755,55 +755,55 @@ function __device_set_file() {
        echo "${value}" > "${path}"
 }
 
-function device_get_rx_bytes() {
+device_get_rx_bytes() {
        local device=${1}
 
        __device_get_file ${device} statistics/rx_bytes
 }
 
-function device_get_tx_bytes() {
+device_get_tx_bytes() {
        local device=${1}
 
        __device_get_file ${device} statistics/tx_bytes
 }
 
-function device_get_rx_packets() {
+device_get_rx_packets() {
        local device=${1}
 
        __device_get_file ${device} statistics/rx_packets
 }
 
-function device_get_tx_packets() {
+device_get_tx_packets() {
        local device=${1}
 
        __device_get_file ${device} statistics/tx_packets
 }
 
-function device_get_rx_errors() {
+device_get_rx_errors() {
        local device=${1}
 
        __device_get_file ${device} statistics/rx_errors
 }
 
-function device_get_tx_errors() {
+device_get_tx_errors() {
        local device=${1}
 
        __device_get_file ${device} statistics/tx_errors
 }
 
-function device_get_speed() {
+device_get_speed() {
        local device=${1}
 
        __device_get_file ${device} speed
 }
 
-function device_get_duplex() {
+device_get_duplex() {
        local device=${1}
 
        __device_get_file ${device} duplex
 }
 
-function device_get_link_string() {
+device_get_link_string() {
        local device="${1}"
        assert isset device
 
index 82698ff059cfab6229fa17e2067d26d52bfae8ec..a3fd90602b88e2051c5f718af09c9ef65295c561 100644 (file)
@@ -97,7 +97,7 @@ DHCPV4D_DEFAULT_LEASE_TIME="43200"    # 12h
 DHCPV4D_MAX_LEASE_TIME="86400"         # 24h
 DHCPV4D_MIN_LEASE_TIME=""
 
-function dhcpd_service() {
+dhcpd_service() {
        case "${1}" in
                ipv6)
                        print "dhcpd6.service"
@@ -113,7 +113,7 @@ function dhcpd_service() {
        return ${EXIT_OK}
 }
 
-function dhcpd_start() {
+dhcpd_start() {
        local services=$(dhcpd_service $@)
 
        local service
@@ -122,7 +122,7 @@ function dhcpd_start() {
        done
 }
 
-function dhcpd_stop() {
+dhcpd_stop() {
        local services=$(dhcpd_service $@)
 
        local service
@@ -131,7 +131,7 @@ function dhcpd_stop() {
        done
 }
 
-function dhcpd_restart() {
+dhcpd_restart() {
        # DHCP does not support a reload, so
        # we retsart it.
        local services=$(dhcpd_service $@)
@@ -142,11 +142,11 @@ function dhcpd_restart() {
        done
 }
 
-function dhcpd_reload() {
+dhcpd_reload() {
        dhcpd_restart $@
 }
 
-function dhcpd_edit() {
+dhcpd_edit() {
        local proto=${1}
        assert isset proto
        shift
@@ -169,7 +169,7 @@ function dhcpd_edit() {
        dhcpd_global_settings_write ${proto}
 }
 
-function _dhcpd_edit_ipv4() {
+_dhcpd_edit_ipv4() {
        local val
 
        while [ $# -gt 0 ]; do
@@ -223,7 +223,7 @@ function _dhcpd_edit_ipv4() {
        fi
 }
 
-function _dhcpd_edit_ipv6() {
+_dhcpd_edit_ipv6() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --preferred-lifetime=*)
@@ -251,7 +251,7 @@ function _dhcpd_edit_ipv6() {
        done
 }
 
-function dhcpd_settings_file() {
+dhcpd_settings_file() {
        local proto=${1}
        assert isset proto
 
@@ -267,7 +267,7 @@ function dhcpd_settings_file() {
        return ${EXIT_OK}
 }
 
-function dhcpd_settings() {
+dhcpd_settings() {
        local proto=${1}
        assert isset proto
 
@@ -283,7 +283,7 @@ function dhcpd_settings() {
        return ${EXIT_OK}
 }
 
-function dhcpd_options_file() {
+dhcpd_options_file() {
        local proto=${1}
        assert isset proto
 
@@ -299,7 +299,7 @@ function dhcpd_options_file() {
        return ${EXIT_OK}
 }
 
-function dhcpd_options_list() {
+dhcpd_options_list() {
        local proto=${1}
        assert isset proto
 
@@ -315,7 +315,7 @@ function dhcpd_options_list() {
        return ${EXIT_OK}
 }
 
-function dhcpd_options() {
+dhcpd_options() {
        local proto=${1}
        assert isset proto
 
@@ -331,14 +331,14 @@ function dhcpd_options() {
        return ${EXIT_OK}
 }
 
-function dhcpd_global_settings_list() {
+dhcpd_global_settings_list() {
        local proto="${1}"
        assert isset proto
 
        dhcpd_settings "${proto}"
 }
 
-function dhcpd_global_settings_defaults() {
+dhcpd_global_settings_defaults() {
        local proto=${1}
        assert isset proto
 
@@ -354,7 +354,7 @@ function dhcpd_global_settings_defaults() {
        done
 }
 
-function dhcpd_global_settings_read() {
+dhcpd_global_settings_read() {
        local proto=${1}
        assert isset proto
 
@@ -368,7 +368,7 @@ function dhcpd_global_settings_read() {
        settings_read ${file} ${settings}
 }
 
-function dhcpd_global_settings_write() {
+dhcpd_global_settings_write() {
        local proto=${1}
        assert isset proto
 
@@ -381,7 +381,7 @@ function dhcpd_global_settings_write() {
        settings_write ${file} ${settings}
 }
 
-function dhcpd_global_options_read() {
+dhcpd_global_options_read() {
        local proto=${1}
        assert isset proto
 
@@ -396,7 +396,7 @@ function dhcpd_global_options_read() {
        fi
 }
 
-function dhcpd_subnet_path() {
+dhcpd_subnet_path() {
        local proto=${1}
        assert isset proto
 
@@ -418,7 +418,7 @@ function dhcpd_subnet_path() {
        return ${EXIT_OK}
 }
 
-function dhcpd_subnet_exists() {
+dhcpd_subnet_exists() {
        local proto=${1}
        assert isset proto
 
@@ -431,7 +431,7 @@ function dhcpd_subnet_exists() {
        [ -d "${path}" ] && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
 
-function dhcpd_subnet_match() {
+dhcpd_subnet_match() {
        local proto=${1}
        assert isset proto
 
@@ -452,7 +452,7 @@ function dhcpd_subnet_match() {
        return ${EXIT_FALSE}
 }
 
-function dhcpd_new_subnet_id() {
+dhcpd_new_subnet_id() {
        local proto=${1}
        assert isset proto
 
@@ -469,7 +469,7 @@ function dhcpd_new_subnet_id() {
        return ${EXIT_ERROR}
 }
 
-function dhcpd_subnet_new() {
+dhcpd_subnet_new() {
        local proto=${1}
        assert isset proto
        shift
@@ -495,7 +495,7 @@ function dhcpd_subnet_new() {
        fi
 }
 
-function dhcpd_subnet_edit() {
+dhcpd_subnet_edit() {
        local proto=${1}
        assert isset proto
        shift
@@ -575,7 +575,7 @@ function dhcpd_subnet_edit() {
        settings_write ${file} ${settings}
 }
 
-function dhcpd_subnet_remove() {
+dhcpd_subnet_remove() {
        local proto=${1}
        assert isset proto
 
@@ -589,7 +589,7 @@ function dhcpd_subnet_remove() {
        rm -rf ${path}
 }
 
-function dhcpd_subnet_list() {
+dhcpd_subnet_list() {
        local proto=${1}
        assert isset proto
 
@@ -608,7 +608,7 @@ function dhcpd_subnet_list() {
        done
 }
 
-function dhcpd_subnet_read() {
+dhcpd_subnet_read() {
        local proto=${1}
        assert isset proto
 
@@ -619,7 +619,7 @@ function dhcpd_subnet_read() {
        settings_read ${file}
 }
 
-function dhcpd_subnet_range_path() {
+dhcpd_subnet_range_path() {
        local proto=${1}
        assert isset proto
 
@@ -633,7 +633,7 @@ function dhcpd_subnet_range_path() {
        return ${EXIT_OK}
 }
 
-function dhcpd_subnet_range_settings() {
+dhcpd_subnet_range_settings() {
        local proto=${1}
 
        case "${proto}" in
@@ -648,7 +648,7 @@ function dhcpd_subnet_range_settings() {
        return ${EXIT_OK}
 }
 
-function dhcpd_subnet_new_range_id() {
+dhcpd_subnet_new_range_id() {
        local proto=${1}
        assert isset proto
 
@@ -669,7 +669,7 @@ function dhcpd_subnet_new_range_id() {
        return ${EXIT_ERROR}
 }
 
-function dhcpd_subnet_range_new() {
+dhcpd_subnet_range_new() {
        local proto=${1}
        assert isset proto
        shift
@@ -699,7 +699,7 @@ function dhcpd_subnet_range_new() {
        return ${EXIT_OK}
 }
 
-function dhcpd_subnet_range_edit() {
+dhcpd_subnet_range_edit() {
        local proto=${1}
        assert isset proto
        shift
@@ -782,14 +782,14 @@ function dhcpd_subnet_range_edit() {
        settings_write ${file} ${settings}
 }
 
-function dhcpd_subnet_range_remove() {
+dhcpd_subnet_range_remove() {
        local path=$(dhcpd_subnet_range_path $@)
        assert isset path
 
        rm -f ${path}
 }
 
-function dhcpd_subnet_range_list() {
+dhcpd_subnet_range_list() {
        local proto=${1}
        assert isset proto
 
@@ -810,7 +810,7 @@ function dhcpd_subnet_range_list() {
        return ${EXIT_OK}
 }
 
-function dhcpd_subnet_range_read() {
+dhcpd_subnet_range_read() {
        local proto=${1}
        assert isset proto
 
@@ -824,7 +824,7 @@ function dhcpd_subnet_range_read() {
        settings_read ${file}
 }
 
-function dhcpd_subnet_settings() {
+dhcpd_subnet_settings() {
        local proto=${1}
 
        case "${proto}" in
@@ -839,14 +839,14 @@ function dhcpd_subnet_settings() {
        return ${EXIT_OK}
 }
 
-function dhcpd_subnet_options_file() {
+dhcpd_subnet_options_file() {
        local path=$(dhcpd_subnet_path $@)
        assert isset path
 
        print "${path}/options"
 }
 
-function dhcpd_subnet_options_list() {
+dhcpd_subnet_options_list() {
        local proto=${1}
        assert isset proto
 
@@ -862,7 +862,7 @@ function dhcpd_subnet_options_list() {
        return ${EXIT_OK}
 }
 
-function dhcpd_subnet_options_read() {
+dhcpd_subnet_options_read() {
        local proto=${1}
        assert isset proto
 
@@ -876,7 +876,7 @@ function dhcpd_subnet_options_read() {
 }
 
 # Helper functions to create a DHCP configuration file.
-function _dhcpd_write_options() {
+_dhcpd_write_options() {
        local proto=${1}
        assert isset proto
 
@@ -916,7 +916,7 @@ function _dhcpd_write_options() {
        fi
 }
 
-function _dhcpd_read_options() {
+_dhcpd_read_options() {
        local file=${1}
        assert isset file
 
@@ -926,7 +926,7 @@ function _dhcpd_read_options() {
        settings_read_array ${file} options ${!options_list}
 }
 
-function _dhcpd_write_subnet() {
+_dhcpd_write_subnet() {
        local proto=${1}
        assert isset proto
 
@@ -978,7 +978,7 @@ function _dhcpd_write_subnet() {
        return ${EXIT_OK}
 }
 
-function _dhcpd_write_subnet_options() {
+_dhcpd_write_subnet_options() {
        local proto=${1}
        assert isset proto
 
@@ -1018,7 +1018,7 @@ function _dhcpd_write_subnet_options() {
        _dhcpd_write_options ${proto} ${file} ${options_list} "\t"
 }
 
-function _dhcpd_search_routers() {
+_dhcpd_search_routers() {
        local proto=${1}
        assert isset proto
 
@@ -1043,7 +1043,7 @@ function _dhcpd_search_routers() {
        list_join routers ", "
 }
 
-function _dhcpd_write_subnet_range() {
+_dhcpd_write_subnet_range() {
        local proto=${1}
        assert isset proto
 
@@ -1079,7 +1079,7 @@ function _dhcpd_write_subnet_range() {
        return ${EXIT_OK}
 }
 
-function dhcpd_write_config() {
+dhcpd_write_config() {
        local proto=${1}
        assert isset proto
 
index 28db4b3900c7a97652c092767713d3a821b5bf4e..b3f42fd0e04609c8332187bf8cea3358db4b382f 100644 (file)
@@ -45,7 +45,7 @@ DNS_SERVER_DYNAMIC_PRIORITY="10"
 # Path to the configuration file of the DNS resolver.
 RESOLV_CONF="/etc/resolv.conf"
 
-function dns_get_hostname() {
+dns_get_hostname() {
        local address=${1}
        assert isset address
 
@@ -56,7 +56,7 @@ function dns_get_hostname() {
        )
 }
 
-function dns_server_list() {
+dns_server_list() {
        [ -r "${DNS_SERVER_CONFIG_FILE}" ] || return ${EXIT_OK}
 
        local line
@@ -70,7 +70,7 @@ function dns_server_list() {
        return ${EXIT_OK}
 }
 
-function dns_server_list_sorted() {
+dns_server_list_sorted() {
        [ -r "${DNS_SERVER_CONFIG_FILE}" ] || return ${EXIT_OK}
 
        local servers=$(
@@ -104,7 +104,7 @@ function dns_server_list_sorted() {
        return ${EXIT_OK}
 }
 
-function dns_server_show() {
+dns_server_show() {
        [ -r "${DNS_SERVER_CONFIG_FILE}" ] || return ${EXIT_OK}
 
        local line
@@ -122,7 +122,7 @@ function dns_server_show() {
        return ${EXIT_OK}
 }
 
-function dns_server_add() {
+dns_server_add() {
        local server=${1}
        assert isset server
 
@@ -139,7 +139,7 @@ function dns_server_add() {
        return ${EXIT_OK}
 }
 
-function dns_server_exists() {
+dns_server_exists() {
        local entry=${1}
        assert isset entry
 
@@ -155,7 +155,7 @@ function dns_server_exists() {
        return ${EXIT_FALSE}
 }
 
-function dns_server_remove() {
+dns_server_remove() {
        local entry=${1}
        assert isset entry
 
@@ -185,11 +185,11 @@ function dns_server_remove() {
        return ${EXIT_OK}
 }
 
-function dns_server_flush() {
+dns_server_flush() {
        : > ${DNS_SERVER_CONFIG_FILE}
 }
 
-function dns_server_parse_line() {
+dns_server_parse_line() {
        local arg
 
        for arg in ${NETWORK_CONFIG_DNS_SERVER_PARAMS}; do
@@ -228,7 +228,7 @@ function dns_server_parse_line() {
 # Update resolv.conf(5) when initializing the network.
 init_register dns_generate_resolvconf
 
-function dns_generate_resolvconf() {
+dns_generate_resolvconf() {
        local file=${RESOLV_CONF}
 
        log INFO "Updating resolver configuration..."
@@ -260,7 +260,7 @@ function dns_generate_resolvconf() {
        done >> ${file}
 }
 
-function dns_get_search_domains() {
+dns_get_search_domains() {
        # Add search domains.
        local search_domains="$(unquote ${DNS_SEARCH_DOMAINS})"
 
@@ -280,7 +280,7 @@ function dns_get_search_domains() {
        list_unique ${search_domains}
 }
 
-function dns_server_get_zone_name_servers() {
+dns_server_get_zone_name_servers() {
        local priority proto server servers zone
 
        for zone in $(zones_get_all); do
index 13c00694bf3177593e7a8aefeee20e20095ef0ab..eaaa51ab26d30720c1a0b3eb2671a0e06aedfe52 100644 (file)
@@ -21,7 +21,7 @@
 
 DUMMY_PORT_PATTERN="dN"
 
-function dummy_create() {
+dummy_create() {
        local device=${1}
        assert isset device
 
@@ -46,7 +46,7 @@ function dummy_create() {
        return ${ret}
 }
 
-function dummy_remove() {
+dummy_remove() {
        local device=${1}
        assert isset device
 
index 494e3bb367edc9be1286293cf7573d4763704a16..c484c2ac1159430220a8c4d0fa705f5f063c09e5 100644 (file)
@@ -21,7 +21,7 @@
 
 # This function initializes all kernel parameters that need to be adjusted
 # to run this firewall properly.
-function firewall_kernel_init() {
+firewall_kernel_init() {
        log INFO "Configuring kernel parameters..."
        local option
 
@@ -151,7 +151,7 @@ function firewall_kernel_init() {
 
 # High-level function which will create a ruleset for the current firewall
 # configuration and load it into the kernel.
-function firewall_start() {
+firewall_start() {
        local protocol="${1}"
        assert isset protocol
        shift
@@ -215,7 +215,7 @@ function firewall_start() {
        firewall_lock_release
 }
 
-function firewall_stop() {
+firewall_stop() {
        local protocol="${1}"
        assert isset protocol
 
@@ -231,7 +231,7 @@ function firewall_stop() {
        firewall_lock_release
 }
 
-function firewall_show() {
+firewall_show() {
        local protocol="${1}"
        assert isset protocol
 
@@ -241,7 +241,7 @@ function firewall_show() {
        return ${EXIT_OK}
 }
 
-function firewall_panic() {
+firewall_panic() {
        local protocol="${1}"
        assert isset protocol
        shift
@@ -267,7 +267,7 @@ function firewall_panic() {
        firewall_lock_release
 }
 
-function firewall_lock_acquire() {
+firewall_lock_acquire() {
        lock_acquire ${RUN_DIR}/.firewall_lock
 
        # Make sure the lock is released after the firewall
@@ -279,7 +279,7 @@ function firewall_lock_acquire() {
        IPTABLES_TMPDIR=$(mktemp -d)
 }
 
-function firewall_lock_release() {
+firewall_lock_release() {
        if isset IPTABLES_TMPDIR; then
                # Remove all temporary data.
                rm -rf ${IPTABLES_TMPDIR}
@@ -294,7 +294,7 @@ function firewall_lock_release() {
        lock_release ${RUN_DIR}/.firewall_lock
 }
 
-function firewall_custom_chains() {
+firewall_custom_chains() {
        local protocol="${1}"
        assert isset protocol
 
@@ -323,7 +323,7 @@ function firewall_custom_chains() {
        iptables "${protocol}" -t nat -A OUTPUT -j CUSTOMOUTPUT
 }
 
-function firewall_filter_invalid_packets() {
+firewall_filter_invalid_packets() {
        local protocol="${1}"
        assert isset protocol
 
@@ -464,7 +464,7 @@ function firewall_filter_invalid_packets() {
        iptables "${protocol}" -A FILTER_INVALID -m conntrack --ctstate INVALID -j DROP
 }
 
-function firewall_tcp_clamp_mss() {
+firewall_tcp_clamp_mss() {
        # Do nothing if this has been disabled.
        enabled FIREWALL_CLAMP_PATH_MTU || return ${EXIT_OK}
 
@@ -477,7 +477,7 @@ function firewall_tcp_clamp_mss() {
                -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
 }
 
-function firewall_connection_tracking() {
+firewall_connection_tracking() {
        local protocol="${1}"
        assert isset protocol
 
@@ -493,7 +493,7 @@ function firewall_connection_tracking() {
        iptables "${protocol}" -A FORWARD -j CONNTRACK
 }
 
-function firewall_localhost_create_chains() {
+firewall_localhost_create_chains() {
        local protocol="${1}"
        assert isset protocol
 
@@ -504,7 +504,7 @@ function firewall_localhost_create_chains() {
        iptables "${protocol}" -A OUTPUT -o lo -j ACCEPT
 }
 
-function firewall_filter_rh0_headers() {
+firewall_filter_rh0_headers() {
        local protocol="${1}"
        assert isset protocol
 
@@ -521,7 +521,7 @@ function firewall_filter_rh0_headers() {
        iptables "${protocol}" -A OUTPUT  -j FILTER_RH0
 }
 
-function firewall_filter_icmp() {
+firewall_filter_icmp() {
        local protocol="${1}"
        assert isset protocol
 
@@ -582,7 +582,7 @@ function firewall_filter_icmp() {
        return ${EXIT_OK}
 }
 
-function firewall_zone_create_chains() {
+firewall_zone_create_chains() {
        local protocol="${1}"
        assert isset protocol
 
@@ -662,7 +662,7 @@ function firewall_zone_create_chains() {
        return ${EXIT_OK}
 }
 
-function firewall_parse_rules() {
+firewall_parse_rules() {
        local file=${1}
        assert isset file
        shift
@@ -723,7 +723,7 @@ function firewall_parse_rules() {
        done < ${file}
 }
 
-function _firewall_parse_rule_line() {
+_firewall_parse_rule_line() {
        local arg
 
        # Clear all values.
index e7b0cf1abdb9ea42b67db5d3158419ece758ef23..8ba55341a88ab5881f068dcffa52d7a8b28bb5b9 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function policy_zone_add() {
+policy_zone_add() {
        local zone=${1}
        assert isset zone
 
@@ -42,7 +42,7 @@ function policy_zone_add() {
        done
 }
 
-function policy_zone_masquerade4() {
+policy_zone_masquerade4() {
        local zone=${1}
        assert isset zone
 
@@ -52,7 +52,7 @@ function policy_zone_masquerade4() {
                -j MASQUERADE --random
 }
 
-function policy_zone_allow_all() {
+policy_zone_allow_all() {
        local zone=${1}
        assert isset zone
 
@@ -65,7 +65,7 @@ function policy_zone_allow_all() {
        iptables -A "${chain}" -m conntrack --ctstate NEW -j ACCEPT
 }
 
-function policy_zone_deny_all() {
+policy_zone_deny_all() {
        local zone=${1}
        assert isset zone
 
@@ -78,13 +78,13 @@ function policy_zone_deny_all() {
        iptables -A "${chain}" -j DROP
 }
 
-function policy_drop_all() {
+policy_drop_all() {
        # Nothing to do here, because that is the
        # default policy of the INPUT/OUTPUT/FORWARD chain.
        :
 }
 
-function policy_import_all_rules() {
+policy_import_all_rules() {
        # This will populate all chains with the rules
        # for the given zone.
 
@@ -103,7 +103,7 @@ function policy_import_all_rules() {
        #       -A ${chain}_RULES_INC
 }
 
-function policy_load() {
+policy_load() {
        local zone_from=${1}
        assert isset zone_from
 
index 397b2bd0a2324478314647d4f615a83d1d9dc428..a72bb8e0033f301523099b51602a7fbc5552b441 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function firewall_zone_create() {
+firewall_zone_create() {
        local zone=${1}
        assert isset zone
 
@@ -35,7 +35,7 @@ function firewall_zone_create() {
        return ${EXIT_OK}
 }
 
-function firewall_zone_config() {
+firewall_zone_config() {
        local zone=${1}
        assert isset zone
 
@@ -43,13 +43,13 @@ function firewall_zone_config() {
        return ${EXIT_OK}
 }
 
-function firewall_zone_exists() {
+firewall_zone_exists() {
        local file=$(firewall_zone_config $@)
 
        [ -r "${file}" ] && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
 
-function firewall_zone_read() {
+firewall_zone_read() {
        local zone=${1}
        assert isset zone
 
@@ -69,7 +69,7 @@ function firewall_zone_read() {
        return ${EXIT_OK}
 }
 
-function firewall_zone_write() {
+firewall_zone_write() {
        local zone=${1}
        assert isset zone
 
@@ -80,7 +80,7 @@ function firewall_zone_write() {
        return ${EXIT_OK}
 }
 
-function firewall_zone_print() {
+firewall_zone_print() {
        local zone=${1}
        assert isset zone
 
@@ -92,7 +92,7 @@ function firewall_zone_print() {
        return ${EXIT_OK}
 }
 
-function firewall_zone_edit() {
+firewall_zone_edit() {
        local zone=${1}
        assert isset zone
        shift
@@ -130,7 +130,7 @@ function firewall_zone_edit() {
        )
 }
 
-function firewall_zone_reset() {
+firewall_zone_reset() {
        local zone=${1}
        assert isset zone
 
index efd23c6a68444a5fed06fb6e872583a65e7e669e..205170cdf110870379ebca5b5c358afafcdb4878 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function he_tunnelbroker_endpoint_update() {
+he_tunnelbroker_endpoint_update() {
        local username
        local password
        local tunnel_id
index f8e2b6b5f02a465cd72ad2c3d2cc59f64782d7c8..88a99ff76ff2000e00060a99d9e11b608255e18a 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function hook_dir() {
+hook_dir() {
        local type=${1}
 
        if [ -n "${type}" ]; then
@@ -30,7 +30,7 @@ function hook_dir() {
 }
 NETWORK_HOOKS_DIR_ZONES="$(hook_dir zone)"
 
-function hook_list() {
+hook_list() {
        local type="${1}"
        assert isoneof type port zone
 
@@ -46,7 +46,7 @@ function hook_list() {
        return ${EXIT_OK}
 }
 
-function hook_exists() {
+hook_exists() {
        local type=${1}
        local hook=${2}
 
@@ -59,7 +59,7 @@ function hook_exists() {
        [ ! -d "${hook}" ] && [ -x "${hook}" ]
 }
 
-function hook_exec() {
+hook_exec() {
        local type="${1}"
        assert isset type
 
@@ -113,7 +113,7 @@ function hook_exec() {
        return ${ret}
 }
 
-function hook_list() {
+hook_list() {
        local type="${1}"
 
        local dir="$(hook_dir "${type}")"
@@ -130,7 +130,7 @@ function hook_list() {
 }
 
 # The default help function.
-function hook_help() {
+hook_help() {
        # If no man page has been configured, we print an error message.
        if [ -z "${HOOK_MANPAGE}" ]; then
                error "There is no help available for hook '${HOOK}'. Exiting."
@@ -142,7 +142,7 @@ function hook_help() {
        exit $?
 }
 
-function config_get_hook() {
+config_get_hook() {
        local config=${1}
 
        assert isset config
@@ -154,31 +154,31 @@ function config_get_hook() {
        )
 }
 
-function hook_zone_exists() {
+hook_zone_exists() {
        hook_exists zone $@
 }
 
-function hook_zone_exec() {
+hook_zone_exec() {
        hook_exec zone $@
 }
 
-function hook_zone_get_all() {
+hook_zone_get_all() {
        hook_list zone
 }
 
-function hook_config_exists() {
+hook_config_exists() {
        hook_exists config $@
 }
 
-function hook_config_exec() {
+hook_config_exec() {
        hook_exec config $@
 }
 
-function hook_config_get_all() {
+hook_config_get_all() {
        hook_list config
 }
 
-function hook_valid_command() {
+hook_valid_command() {
        local type="${1}"
        local cmd="${2}"
 
@@ -200,7 +200,7 @@ function hook_valid_command() {
        return ${EXIT_FALSE}
 }
 
-function hook_valid_command_config() {
+hook_valid_command_config() {
        local cmd="${1}"
 
        case "${cmd}" in
@@ -212,7 +212,7 @@ function hook_valid_command_config() {
        return ${EXIT_FALSE}
 }
 
-function hook_valid_command_port() {
+hook_valid_command_port() {
        local cmd="${1}"
 
        case "${cmd}" in
@@ -240,7 +240,7 @@ function hook_valid_command_port() {
        return ${EXIT_FALSE}
 }
 
-function hook_valid_command_zone() {
+hook_valid_command_zone() {
        local cmd="${1}"
 
        case "${cmd}" in
index d98bf9fe899471d26b89e2cba365329e4b8e911f..f7bf2fa58bc343ec379a5acc3ecfe52e8a0d1fd7 100644 (file)
@@ -21,7 +21,7 @@
 
 HOSTAPD_CONTROL_INTERFACE_DIR="/run/hostapd/ctrl"
 
-function hostapd_config_write() {
+hostapd_config_write() {
        local device=${1}
        assert isset device
 
@@ -191,7 +191,7 @@ function hostapd_config_write() {
        return ${EXIT_OK}
 }
 
-function hostapd_start() {
+hostapd_start() {
        local device=${1}
        assert isset device
 
@@ -208,7 +208,7 @@ function hostapd_start() {
        return ${EXIT_OK}
 }
 
-function hostapd_stop() {
+hostapd_stop() {
        local device=${1}
        assert isset device
 
index 80089ac3821ef668e5b236dbf2a54c67b2acf66f..8fccae4e7c6ef9f645cf4ebf02b8a262e25d9d69 100644 (file)
 #                                                                             #
 ###############################################################################
 
-function hotplug_assert_in_hotplug_event() {
+hotplug_assert_in_hotplug_event() {
        assert [ -n "${IN_HOTPLUG_EVENT}" ]
 }
 
-function hotplug_action() {
+hotplug_action() {
        hotplug_assert_in_hotplug_event
 
        echo "${ACTION}"
 }
 
-function hotplug_propagate_all_ports() {
+hotplug_propagate_all_ports() {
        hotplug_assert_in_hotplug_event
 
        # Create configured child devices.
@@ -50,7 +50,7 @@ function hotplug_propagate_all_ports() {
        done
 }
 
-function hotplug_propagate_all_zones() {
+hotplug_propagate_all_zones() {
        hotplug_assert_in_hotplug_event
 
        local zone
@@ -70,7 +70,7 @@ function hotplug_propagate_all_zones() {
        done
 }
 
-function hotplug_event_port_is_interface() {
+hotplug_event_port_is_interface() {
        hotplug_assert_in_hotplug_event
 
        local port="${1}"
@@ -79,7 +79,7 @@ function hotplug_event_port_is_interface() {
        [ "${port}" = "${INTERFACE}" ]
 }
 
-function hotplug_event_interface_is_slave_of_port() {
+hotplug_event_interface_is_slave_of_port() {
        hotplug_assert_in_hotplug_event
 
        local port="${1}"
@@ -92,7 +92,7 @@ function hotplug_event_interface_is_slave_of_port() {
        list_match "${INTERFACE}" ${slaves}
 }
 
-function hotplug_event_interface_is_port_of_zone() {
+hotplug_event_interface_is_port_of_zone() {
        hotplug_assert_in_hotplug_event
 
        local zone="${1}"
@@ -105,7 +105,7 @@ function hotplug_event_interface_is_port_of_zone() {
        list_match "${INTERFACE}" ${ports}
 }
 
-function hotplug_event_port_uses_phy() {
+hotplug_event_port_uses_phy() {
        hotplug_assert_in_hotplug_event
 
        local port="${1}"
index 1c61443c9a289706cb77286d8e443366c2fc9991..693f9f87e340286713a32a40de90418c5560c104 100644 (file)
 #                                                                             #
 ###############################################################################
 
-function http_format_args() {
+http_format_args() {
        local args="$@"
 
        list_join args "&"
 }
 
-function http_GET() {
+http_GET() {
        local username
        local password
 
@@ -68,7 +68,7 @@ function http_GET() {
        http_call "${url}"
 }
 
-function http_call() {
+http_call() {
        # Argument list for invoking curl.
        local args
 
index 61327d58e8e6d0b0197611fc422372c23eb3c649..873b6beacab5a7e5e00f811a781a5c4eb8e1d41b 100644 (file)
@@ -25,11 +25,11 @@ export PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/bin:/bin:${PATH}"
 
 INIT_FUNCTIONS=""
 
-function init_register() {
+init_register() {
        INIT_FUNCTIONS="${INIT_FUNCTIONS} $@"
 }
 
-function init_run() {
+init_run() {
        local init
        for init in ${INIT_FUNCTIONS}; do
                ${init}
index 7e47d07630346ff1ca581e2aef61a4017f2e8808..208488ff6331690497bcf7f7d0c7e5735005c947 100644 (file)
 # A list of supported versions of the IP protocol
 IP_SUPPORTED_PROTOCOLS=""
 
-function ip_split_prefix() {
+ip_split_prefix() {
        local address=${1}
        assert isset address
 
        echo "${address%%/*}"
 }
 
-function ip_get_prefix() {
+ip_get_prefix() {
        local address=${1}
        assert isset address
 
@@ -39,7 +39,7 @@ function ip_get_prefix() {
        echo "${address##*/}"
 }
 
-function ip_detect_protocol() {
+ip_detect_protocol() {
        local address=${1}
 
        assert isset address
@@ -55,7 +55,7 @@ function ip_detect_protocol() {
        return ${EXIT_ERROR}
 }
 
-function ip_protocol_is_supported() {
+ip_protocol_is_supported() {
        local proto=${1}
 
        assert isset proto
@@ -63,7 +63,7 @@ function ip_protocol_is_supported() {
        listmatch ${proto} ${IP_SUPPORTED_PROTOCOLS}
 }
 
-function ip_is_valid() {
+ip_is_valid() {
        local address=${1}
        assert isset address
 
@@ -71,7 +71,7 @@ function ip_is_valid() {
        isset proto && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
 
-function ip_is_network() {
+ip_is_network() {
        local network=${1}
        assert isset network
 
@@ -93,7 +93,7 @@ function ip_is_network() {
        return ${EXIT_TRUE}
 }
 
-function ip_prefix_is_valid() {
+ip_prefix_is_valid() {
        local proto=${1}
        assert isset proto
 
@@ -113,7 +113,7 @@ function ip_prefix_is_valid() {
        assert ip_protocol_is_supported ${proto}
 }
 
-function ip_address_add() {
+ip_address_add() {
        local device=${1}
        local address=${2}
 
@@ -157,7 +157,7 @@ function ip_address_add() {
        return ${EXIT_OK}
 }
 
-function ip_address_del() {
+ip_address_del() {
        local device=${1}
        local address=${2}
 
index 342be3c3e3587e0b3ddef50f566182d2a1466aaa..36881f2824b5b713592f75b92d7214d8a6787b76 100644 (file)
@@ -21,7 +21,7 @@
 
 IP_TUNNEL_MODES="sit"
 
-function ip_tunnel_add() {
+ip_tunnel_add() {
        local device=${1}
        shift
 
@@ -78,7 +78,7 @@ function ip_tunnel_add() {
        assert [ $? -eq 0 ]
 }
 
-function ip_tunnel_del() {
+ip_tunnel_del() {
        local device=${1}
        assert device_exists ${device}
 
@@ -91,7 +91,7 @@ function ip_tunnel_del() {
        assert [ $? -eq 0 ]
 }
 
-function ip_tunnel_6rd_set_prefix() {
+ip_tunnel_6rd_set_prefix() {
        local device="${1}"
        assert isset device
 
index fe5197850ab46b755e708cac7ca65d05bcf9b2eb..86627a4222bbeca61f1c624ae94a9cd68e6e9985 100644 (file)
@@ -21,7 +21,7 @@
 
 IPTABLES_TABLES="filter mangle nat"
 
-function iptables() {
+iptables() {
        local protocol="${1}"
        assert isset protocol
        shift
@@ -100,7 +100,7 @@ function iptables() {
        assert_check_retval $?
 }
 
-function iptables_chain_create() {
+iptables_chain_create() {
        local protocol="${1}"
        assert isset protocol
        shift
@@ -136,7 +136,7 @@ function iptables_chain_create() {
 }
 
 # Calls the binary iptables command.
-function _iptables() {
+_iptables() {
        local protocol="${1}"
        assert isset protocol
        shift
@@ -157,7 +157,7 @@ function _iptables() {
        return $?
 }
 
-function iptables_status() {
+iptables_status() {
        local protocol="${1}"
        assert isset protocol
 
@@ -171,7 +171,7 @@ function iptables_status() {
        return ${EXIT_OK}
 }
 
-function iptables_rulesfile() {
+iptables_rulesfile() {
        local proto=${1}
        proto=${proto/ipv/}
 
@@ -181,7 +181,7 @@ function iptables_rulesfile() {
        print "${IPTABLES_TMPDIR}/${chain}${proto}"
 }
 
-function iptables_init() {
+iptables_init() {
        local protocol="${1}"
        assert isset protocol
 
@@ -210,7 +210,7 @@ function iptables_init() {
 }
 
 # Load the created ruleset into the kernel.
-function iptables_commit () {
+iptables_commit () {
        local protocol="${1}"
        assert isset protocol
        shift
@@ -277,7 +277,7 @@ function iptables_commit () {
        return ${EXIT_OK}
 }
 
-function _iptables_commit_cat_rulesfile() {
+_iptables_commit_cat_rulesfile() {
        local protocol="${1}"
        assert isset protocol
 
@@ -298,7 +298,7 @@ function _iptables_commit_cat_rulesfile() {
        assert [ -s "${rulesfile}" ]
 }
 
-function _iptables_commit_load_rulesfile() {
+_iptables_commit_load_rulesfile() {
        local protocol="${1}"
        assert isset protocol
 
@@ -356,7 +356,7 @@ function _iptables_commit_load_rulesfile() {
        return ${ret}
 }
 
-function iptables_dump() {
+iptables_dump() {
        local protocol="${1}"
        assert isset protocol
 
@@ -391,7 +391,7 @@ function iptables_dump() {
        done < "${rulesfile}"
 }
 
-function iptables_LOG() {
+iptables_LOG() {
        local prefix="${1}"
        local ret
 
@@ -425,7 +425,7 @@ function iptables_LOG() {
        print "${ret}"
 }
 
-function iptables_protocol() {
+iptables_protocol() {
        local PROTO
        PROTO=$1
        for proto in tcp udp esp ah; do
@@ -440,15 +440,15 @@ IPTABLES_PORT=0
 IPTABLES_MULTIPORT=1
 IPTABLES_PORTRANGE=2
 
-function _iptables_port_range() {
+_iptables_port_range() {
        grep -q ":" <<< $@
 }
 
-function _iptables_port_multiport() {
+_iptables_port_multiport() {
        grep -q "," <<< $@
 }
 
-function _iptables_port() {
+_iptables_port() {
        if _iptables_port_range "$@"; then
                echo $IPTABLES_PORTRANGE
        elif _iptables_port_multiport "$@"; then
@@ -458,7 +458,7 @@ function _iptables_port() {
        fi
 }
 
-function iptables_source_port() {
+iptables_source_port() {
        [ -z "$@" ] && return
        local type
        type=$(_iptables_port $@)
@@ -469,7 +469,7 @@ function iptables_source_port() {
        fi
 }
 
-function iptables_destination_port() {
+iptables_destination_port() {
        [ -z "$@" ] && return
        local type
        type=$(_iptables_port $@)
index be836a2888f4041487deb18eb41daac15d7e05c0..d22b25f6c00ddddd38abec9dfe3c8b73282126ac 100644 (file)
@@ -21,7 +21,7 @@
 
 IP_SUPPORTED_PROTOCOLS="${IP_SUPPORTED_PROTOCOLS} ipv4"
 
-function ipv4_is_valid() {
+ipv4_is_valid() {
        ipcalc --ipv4 -c $@ >/dev/null 2>&1
 
        case "$?" in
@@ -34,7 +34,7 @@ function ipv4_is_valid() {
        esac
 }
 
-function ipv4_prefix_is_valid() {
+ipv4_prefix_is_valid() {
        local prefix=${1}
 
        isset prefix || return ${EXIT_FALSE}
@@ -45,7 +45,7 @@ function ipv4_prefix_is_valid() {
        return ${EXIT_TRUE}
 }
 
-function ipv4_netmask_is_valid() {
+ipv4_netmask_is_valid() {
        local netmask="${1}"
 
        # XXX this check could be much better by checking
@@ -54,7 +54,7 @@ function ipv4_netmask_is_valid() {
        ipv4_is_valid "${netmask}"
 }
 
-function ipv4_detect_duplicate() {
+ipv4_detect_duplicate() {
        local device=${1}
        local address=${2}
 
@@ -73,7 +73,7 @@ function ipv4_detect_duplicate() {
        return ${EXIT_ERROR}
 }
 
-function ipv4_update_neighbours() {
+ipv4_update_neighbours() {
        local device=${1}
        local address=${2}
 
@@ -84,7 +84,7 @@ function ipv4_update_neighbours() {
        ( sleep 2; arping -q -U -c 1 -I ${device} ${address} ) >/dev/null 2>&1 </dev/null &
 }
 
-function ipv4_get_netaddress() {
+ipv4_get_netaddress() {
        local address=${1}
        assert isset address
 
@@ -105,7 +105,7 @@ function ipv4_get_netaddress() {
        return ${EXIT_OK}
 }
 
-function ipv4_get_prefix() {
+ipv4_get_prefix() {
        local address=${1}
        local broadcast=${2}
 
@@ -120,7 +120,7 @@ function ipv4_get_prefix() {
        return ${EXIT_OK}
 }
 
-function ipv4_get_netmask() {
+ipv4_get_netmask() {
        local address=${1}
        assert isset address
 
@@ -136,7 +136,7 @@ function ipv4_get_netmask() {
        return ${EXIT_OK}
 }
 
-function ipv4_flush_device() {
+ipv4_flush_device() {
        #
        # Flushes all routes, addresses from the device
        # and clears the ARP cache.
@@ -152,7 +152,7 @@ function ipv4_flush_device() {
        return 0
 }
 
-function ipv4_prefix2netmask() {
+ipv4_prefix2netmask() {
        local prefix=${1}
        shift
 
@@ -170,7 +170,7 @@ function ipv4_prefix2netmask() {
        esac
 }
 
-function ipv4_netmask2prefix() {
+ipv4_netmask2prefix() {
        local netmask="${1}"
        assert isset netmask
 
@@ -194,13 +194,13 @@ function ipv4_netmask2prefix() {
        print "${cidr}"
 }
 
-function ipv4_get_network() {
+ipv4_get_network() {
        local network=$(ipv4_get_network_encoded $@)
 
        ipv4_decode ${network}
 }
 
-function ipv4_get_network_encoded() {
+ipv4_get_network_encoded() {
        local net=${1}
 
        local prefix=$(ip_get_prefix ${net})
@@ -217,13 +217,13 @@ function ipv4_get_network_encoded() {
        print "%d" $(( ${addr} & ${mask} ))
 }
 
-function ipv4_get_broadcast() {
+ipv4_get_broadcast() {
        local broadcast=$(ipv4_get_broadcast_encoded $@)
 
        ipv4_decode ${broadcast}
 }
 
-function ipv4_get_broadcast_encoded() {
+ipv4_get_broadcast_encoded() {
        local net=${1}
 
        local prefix=$(ip_get_prefix ${net})
@@ -246,7 +246,7 @@ function ipv4_get_broadcast_encoded() {
        print "%d" $(( $(( ${addr} & ${netmask} )) | ${broadcast} ))
 }
 
-function ipv4_encode() {
+ipv4_encode() {
        local addr=${1}
        local int=0
 
@@ -258,7 +258,7 @@ function ipv4_encode() {
        print "${int}"
 }
 
-function ipv4_decode() {
+ipv4_decode() {
        local int=${1}
 
        local addr=$(( ${int} & 255 ))
@@ -272,7 +272,7 @@ function ipv4_decode() {
        print "${addr}"
 }
 
-function ipv4_addr_eq() {
+ipv4_addr_eq() {
        local addr1=${1}
        assert isset addr1
 
@@ -283,7 +283,7 @@ function ipv4_addr_eq() {
                && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
 
-function ipv4_addr_gt() {
+ipv4_addr_gt() {
        local addr1=${1}
        assert isset addr1
 
@@ -299,7 +299,7 @@ function ipv4_addr_gt() {
                && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
 
-function ipv4_range() {
+ipv4_range() {
        local range=${1}
 
        local first=${1%-*}
@@ -308,7 +308,7 @@ function ipv4_range() {
        _ipv4_range "$(ipv4_encode ${first})" "$(ipv4_encode ${last})"
 }
 
-function _ipv4_range() {
+_ipv4_range() {
        local first=${1}
        local last=${2}
 
@@ -341,7 +341,7 @@ function _ipv4_range() {
        done
 }
 
-function ipv4_range_explicit() {
+ipv4_range_explicit() {
        local range=${1}
 
        local first last
@@ -360,7 +360,7 @@ function ipv4_range_explicit() {
        _ipv4_range_explicit "$(ipv4_encode ${first})" "$(ipv4_encode ${last})"
 }
 
-function _ipv4_range_explicit() {
+_ipv4_range_explicit() {
        local first=${1}
        local last=${2}
 
@@ -377,7 +377,7 @@ function _ipv4_range_explicit() {
        done
 }
 
-function ipv4_in_subnet() {
+ipv4_in_subnet() {
        local addr=${1}
        assert isset addr
 
@@ -396,7 +396,7 @@ function ipv4_in_subnet() {
        return ${EXIT_FALSE}
 }
 
-function ipv4_ttl_valid() {
+ipv4_ttl_valid() {
        local ttl="${1}"
 
        isinteger ttl || return ${EXIT_FALSE}
index 55540527816836c8dd871965b2c6db724c05b43e..74e01c0091f923d4f5563fe6de369d94a6174b6b 100644 (file)
@@ -21,7 +21,7 @@
 
 IP_SUPPORTED_PROTOCOLS="${IP_SUPPORTED_PROTOCOLS} ipv6"
 
-function ipv6_device_autoconf_enable() {
+ipv6_device_autoconf_enable() {
        local device="${1}"
        assert device_exists "${device}"
 
@@ -35,7 +35,7 @@ function ipv6_device_autoconf_enable() {
        ipv6_device_forwarding_disable "${device}"
 }
 
-function ipv6_device_autoconf_disable() {
+ipv6_device_autoconf_disable() {
        local device="${1}"
        assert device_exists "${device}"
 
@@ -51,7 +51,7 @@ function ipv6_device_autoconf_disable() {
        ipv6_device_privacy_extensions_disable "${device}"
 }
 
-function ipv6_device_forwarding_enable() {
+ipv6_device_forwarding_enable() {
        local device="${1}"
 
        sysctl_set "net.ipv6.conf.${device}.forwarding" 1
@@ -59,7 +59,7 @@ function ipv6_device_forwarding_enable() {
        log INFO "Enabled IPv6 forwarding on '${device}'"
 }
 
-function ipv6_device_forwarding_disable() {
+ipv6_device_forwarding_disable() {
        local device="${1}"
 
        sysctl_set "net.ipv6.conf.${device}.forwarding" 0
@@ -68,21 +68,21 @@ function ipv6_device_forwarding_disable() {
 }
 
 # Enable IPv6 RFC3041 privacy extensions if desired
-function ipv6_device_privacy_extensions_enable() {
+ipv6_device_privacy_extensions_enable() {
        local device="${1}"
        assert device_exists "${device}"
 
        sysctl_set "net.ipv6.conf.${device}.use_tempaddr" 2
 }
 
-function ipv6_device_privacy_extensions_disable() {
+ipv6_device_privacy_extensions_disable() {
        local device="${1}"
        assert device_exists "${device}"
 
        sysctl_set "net.ipv6.conf.${device}.use_tempaddr" 0
 }
 
-function ipv6_is_valid() {
+ipv6_is_valid() {
        ipcalc --ipv6 -c $@ >/dev/null 2>&1
 
        case "$?" in
@@ -95,7 +95,7 @@ function ipv6_is_valid() {
        esac
 }
 
-function ipv6_prefix_is_valid() {
+ipv6_prefix_is_valid() {
        local prefix=${1}
        assert isset prefix
 
@@ -105,15 +105,15 @@ function ipv6_prefix_is_valid() {
        return ${EXIT_TRUE}
 }
 
-function ipv6_get_prefix() {
+ipv6_get_prefix() {
        ip_get_prefix "$@"
 }
 
-function ipv6_split_prefix() {
+ipv6_split_prefix() {
        ip_split_prefix "$@"
 }
 
-function ipv6_address_add() {
+ipv6_address_add() {
        local address="${1}"
        assert isset address
 
@@ -191,14 +191,14 @@ function ipv6_address_add() {
        return ${EXIT_OK}
 }
 
-function ipv6_address_del() {
+ipv6_address_del() {
        local address="${1}"
        local device="${2}"
 
        ip_address_del "${device}" "${address}"
 }
 
-function ipv6_address_flush() {
+ipv6_address_flush() {
        local device="${1}"
        assert isset device
 
@@ -208,7 +208,7 @@ function ipv6_address_flush() {
        cmd_quiet ip -6 addr flush dev "${device}" scope global permanent
 }
 
-function ipv6_address_change_lifetime() {
+ipv6_address_change_lifetime() {
        local address="${1}"
        assert isset address
 
@@ -258,7 +258,7 @@ function ipv6_address_change_lifetime() {
        return ${EXIT_OK}
 }
 
-function ipv6_get_dad_status() {
+ipv6_get_dad_status() {
        local address="${1}"
        assert isset address
 
@@ -287,7 +287,7 @@ function ipv6_get_dad_status() {
        return ${EXIT_DAD_OK}
 }
 
-function ipv6_wait_for_dad() {
+ipv6_wait_for_dad() {
        local address="${1}"
        assert isset address
 
@@ -320,7 +320,7 @@ function ipv6_wait_for_dad() {
        return ${EXIT_ERROR}
 }
 
-function ipv6_device_get_addresses() {
+ipv6_device_get_addresses() {
        local device="${1}"
        assert isset device
        shift
@@ -359,7 +359,7 @@ function ipv6_device_get_addresses() {
        list_sort ${addresses}
 }
 
-function ipv6_implode() {
+ipv6_implode() {
        local address=${1}
        assert isset address
 
@@ -370,7 +370,7 @@ function ipv6_implode() {
        print "${ADDRESS6_IMPL}"
 }
 
-function ipv6_explode() {
+ipv6_explode() {
        local address=${1}
        assert isset address
 
@@ -387,7 +387,7 @@ function ipv6_explode() {
        print "${ADDRESS6_EXPL}"
 }
 
-function ipv6_addr_eq() {
+ipv6_addr_eq() {
        local addr1=${1}
        assert isset addr1
 
@@ -403,7 +403,7 @@ function ipv6_addr_eq() {
                && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
 
-function ipv6_addr_gt() {
+ipv6_addr_gt() {
        local addr1=${1}
        assert isset addr1
 
@@ -426,7 +426,7 @@ function ipv6_addr_gt() {
        return ${EXIT_FALSE}
 }
 
-function ipv6_hash() {
+ipv6_hash() {
        local address=${1}
 
        assert isset address
@@ -437,7 +437,7 @@ function ipv6_hash() {
        echo "${address//:/}"
 }
 
-function ipv6_get_network() {
+ipv6_get_network() {
        local addr=${1}
        assert isset addr
 
@@ -452,7 +452,7 @@ function ipv6_get_network() {
        print "${PREFIX6}/${prefix}"
 }
 
-function ipv6_6rd_format_address() {
+ipv6_6rd_format_address() {
        local isp_prefix="${1}"
        assert ipv6_is_valid "${isp_prefix}"
 
@@ -518,7 +518,7 @@ function ipv6_6rd_format_address() {
        print "${formatted_address}/${prefix}"
 }
 
-function ipv6_6rd_format_client_address() {
+ipv6_6rd_format_client_address() {
        local address="${1}"
        assert isset address
 
index 5515edb746e1195696c9c389883dff92eb1cfdf8..7069168513e05c22b79f62e6a903a18b788d1091 100644 (file)
@@ -22,7 +22,7 @@
 # Functions for nice handling of lists.
 #
 
-function list_append() {
+list_append() {
        local list=${1}
        assert isset list
        shift
@@ -33,7 +33,7 @@ function list_append() {
        done
 }
 
-function list_append_one() {
+list_append_one() {
        assert [ $# -eq 2 ]
 
        local list="${1}"
@@ -48,7 +48,7 @@ function list_append_one() {
        fi
 }
 
-function list_remove() {
+list_remove() {
        local list=${1}
        shift
 
@@ -64,7 +64,7 @@ function list_remove() {
        eval "${list}=\"${_list}\""
 }
 
-function list_sort() {
+list_sort() {
        local i
        for i in $@; do
                print "${i}"
@@ -72,7 +72,7 @@ function list_sort() {
        print
 }
 
-function list_unique() {
+list_unique() {
        local items item
        for item in $@; do
                # Check if the item has already been processed.
@@ -83,7 +83,7 @@ function list_unique() {
        done
 }
 
-function list_match() {
+list_match() {
        local match=${1}
        shift
 
@@ -95,7 +95,7 @@ function list_match() {
        return ${EXIT_ERROR}
 }
 
-function list_length() {
+list_length() {
        local length=0
 
        local i
@@ -107,7 +107,7 @@ function list_length() {
 }
 
 # Count how often $1 occurs in the list.
-function list_count() {
+list_count() {
        local what=${1}
        shift
 
@@ -123,7 +123,7 @@ function list_count() {
        print "${counter}"
 }
 
-function list_join() {
+list_join() {
        local list=${1}
        local delim=${2}
 
@@ -133,7 +133,7 @@ function list_join() {
        print "${ret:${#delim}}"
 }
 
-function list_reverse() {
+list_reverse() {
        local reversed arg
        for arg in $@; do
                reversed="${arg} ${reversed}"
@@ -143,7 +143,7 @@ function list_reverse() {
        return ${EXIT_OK}
 }
 
-function list_head() {
+list_head() {
        local arg
        for arg in $@; do
                print "${arg}"
index 72414054b38584d5bf76a24c1264542c2952e502..136a223c443c883535a24f2d327f91ed40a7607b 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function lock_acquire() {
+lock_acquire() {
        local lockfile="${1}"
        assert isset lockfile
 
@@ -48,7 +48,7 @@ function lock_acquire() {
        chmod 600 ${lockfile}
 }
 
-function lock_release() {
+lock_release() {
        local lockfile="${1}"
 
        log DEBUG "Releasing lock '${lockfile}'."
index eefa3c413bd073e8ec45e0a3c4142b43292a52a4..07698160d984b95aaa2dd05b5b3ff2a43436eebe 100644 (file)
@@ -29,7 +29,7 @@ if [ -z "${LOG_DISABLE_STDOUT}" ]; then
        LOG_DISABLE_STDOUT=false
 fi
 
-function log() {
+log() {
        local level=${1}
        shift
        local message="$@"
index 785e5719e7a303b58d3c63c2d839581faa2dde8b..bfa3d1a36d00e4ab8a835bc3cec43da13789fce5 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function macro_file() {
+macro_file() {
        local macro=${1}
        assert isset macro
 
@@ -40,7 +40,7 @@ function macro_file() {
        return ${EXIT_ERROR}
 }
 
-function macro_exists() {
+macro_exists() {
        local macro=${1}
        assert isset macro
 
@@ -48,7 +48,7 @@ function macro_exists() {
                && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
 
-function macro_read() {
+macro_read() {
        local macro=${1}
        assert isset macro
 
index 8d96b1abe37c05720574a169b036708c0788a0b2..d85fdd391248da48ce79c62eea3f51765ad1fac6 100644 (file)
@@ -25,7 +25,7 @@ CHAT_INVALID=1
 CHAT_ERROR=2
 CHAT_TIMEOUT=3
 
-function modem_chat() {
+modem_chat() {
        local answer="OK"
        local device
        local timeout=2
@@ -91,7 +91,7 @@ function modem_chat() {
        return ${EXIT_ERROR}
 }
 
-function __modem_chat_process_output() {
+__modem_chat_process_output() {
        local answer=${1}
        local quiet=${2}
 
@@ -125,7 +125,7 @@ function __modem_chat_process_output() {
        done
 }
 
-function modem_initialize() {
+modem_initialize() {
        local device="${1}"
        assert isset device
        shift
@@ -164,7 +164,7 @@ EXIT_SIM_PIN=1
 EXIT_SIM_PUK=2
 EXIT_SIM_UNKNOWN=3
 
-function modem_sim_status() {
+modem_sim_status() {
        local device=${1}
        assert isset device
 
@@ -194,7 +194,7 @@ function modem_sim_status() {
        return ${EXIT_SIM_UNKNOWN}
 }
 
-function modem_sim_unlocked() {
+modem_sim_unlocked() {
        local device=${1}
        assert isset device
 
@@ -204,11 +204,11 @@ function modem_sim_unlocked() {
        [ ${ret} -eq ${EXIT_SIM_READY} ] && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
 
-function modem_sim_locked() {
+modem_sim_locked() {
        modem_sim_unlocked $@ && return ${EXIT_FALSE} || return ${EXIT_TRUE}
 }
 
-function modem_sim_unlock() {
+modem_sim_unlock() {
        local device=${1}
        assert isset device
 
@@ -238,7 +238,7 @@ function modem_sim_unlock() {
        return ${ret}
 }
 
-function modem_sim_auto_unlock() {
+modem_sim_auto_unlock() {
        local device="${1}"
        assert isset device
 
@@ -274,7 +274,7 @@ function modem_sim_auto_unlock() {
 
 # Returns the vendor of the modem.
 # For example: "huawei"
-function modem_get_manufacturer() {
+modem_get_manufacturer() {
        local device=${1}
        assert isset device
 
@@ -288,7 +288,7 @@ function modem_get_manufacturer() {
        print "${output}"
 }
 
-function modem_get_model() {
+modem_get_model() {
        local device=${1}
        assert isset device
 
@@ -302,7 +302,7 @@ function modem_get_model() {
        print "${output}"
 }
 
-function modem_get_software_version() {
+modem_get_software_version() {
        local device=${1}
        assert isset device
 
@@ -316,7 +316,7 @@ function modem_get_software_version() {
        print "${output}"
 }
 
-function modem_get_sim_imsi() {
+modem_get_sim_imsi() {
        local device=${1}
        assert isset device
 
@@ -326,7 +326,7 @@ function modem_get_sim_imsi() {
        modem_chat ${device} "AT+CIMI"
 }
 
-function modem_get_device_imei() {
+modem_get_device_imei() {
        local device=${1}
        assert isset device
 
@@ -341,7 +341,7 @@ function modem_get_device_imei() {
        return ${ret}
 }
 
-function modem_is_mobile() {
+modem_is_mobile() {
        local device=${1}
        assert isset device
 
@@ -360,7 +360,7 @@ EXIT_REG_REGISTRATION_DENIED=3
 EXIT_REG_REGISTERED_ROAMING=4
 EXIT_REG_UNKNOWN=5
 
-function modem_get_network_registration() {
+modem_get_network_registration() {
        local device=${1}
        assert isset device
 
@@ -413,7 +413,7 @@ function modem_get_network_registration() {
        modem_get_network_registration ${device}
 }
 
-function modem_set_network_registration() {
+modem_set_network_registration() {
        local device=${1}
        assert isset device
 
@@ -426,7 +426,7 @@ function modem_set_network_registration() {
        modem_chat ${device} "AT+CREG=${mode}"
 }
 
-function modem_scan_networks() {
+modem_scan_networks() {
        local device=${1}
        assert isset device
 
@@ -442,7 +442,7 @@ function modem_scan_networks() {
        # XXX the output is not very nice to parse.
 }
 
-function __modem_get_network_operator() {
+__modem_get_network_operator() {
        local device=${1}
        assert isset device
 
@@ -486,7 +486,7 @@ function __modem_get_network_operator() {
        return ${EXIT_OK}
 }
 
-function modem_get_network_operator() {
+modem_get_network_operator() {
        local device=${1}
        assert isset device
 
@@ -503,7 +503,7 @@ EXIT_OPMODE_UMTS_WITH_HSUPA=5
 EXIT_OPMODE_UMTS_WITH_HSDPA_AND_HSUPA=6
 EXIT_OPMODE_UNKNOWN=7
 
-function modem_get_network_mode() {
+modem_get_network_mode() {
        local device=${1}
        assert isset device
 
@@ -543,7 +543,7 @@ function modem_get_network_mode() {
        esac
 }
 
-function __modem_get_signal_quality() {
+__modem_get_signal_quality() {
        local device=${1}
        assert isset device
 
@@ -575,7 +575,7 @@ function __modem_get_signal_quality() {
        return ${EXIT_ERROR}
 }
 
-function modem_get_signal_quality() {
+modem_get_signal_quality() {
        local device=${1}
        assert isset device
 
@@ -595,7 +595,7 @@ function modem_get_signal_quality() {
        return ${EXIT_OK}
 }
 
-function modem_get_bit_error_rate() {
+modem_get_bit_error_rate() {
        local device=${1}
        assert isset device
 
@@ -615,7 +615,7 @@ function modem_get_bit_error_rate() {
 
 # USDD stuff
 
-function modem_ussd_send_command() {
+modem_ussd_send_command() {
        local device="${1}"
        assert isset device
 
@@ -658,7 +658,7 @@ function modem_ussd_send_command() {
        return ${ret}
 }
 
-function __modem_ussd_parse_output() {
+__modem_ussd_parse_output() {
        local line
        while read -r line; do
                # Find the expected answer.
@@ -717,7 +717,7 @@ function __modem_ussd_parse_output() {
        return ${EXIT_ERROR}
 }
 
-function modem_ussd_encode() {
+modem_ussd_encode() {
        local string="${1}"
        assert isset string
 
@@ -744,7 +744,7 @@ function modem_ussd_encode() {
        print "${output}"
 }
 
-function modem_ussd_decode() {
+modem_ussd_decode() {
        local string="${1}"
        assert isset string
 
index 90288f76921cb3d96d809637b41f3568027a1f41..f79cb95feb597463c1453e317a948ba5ca6ebf1d 100644 (file)
 
 PHY_DIR="/sys/class/ieee80211"
 
-function phy_dir() {
+phy_dir() {
        local phy=${1}
 
        echo "${PHY_DIR}/${phy}"
 }
 
-function phy_exists() {
+phy_exists() {
        local phy=${1}
        assert isset phy
 
        [ -d "$(phy_dir ${phy})" ]
 }
 
-function phy_list() {
+phy_list() {
        local phy
 
        for phy in $(phy_dir)/*; do
@@ -44,7 +44,7 @@ function phy_list() {
        done
 }
 
-function phy_get() {
+phy_get() {
        local info="${1}"
        local phy
 
@@ -81,7 +81,7 @@ function phy_get() {
        return ${EXIT_OK}
 }
 
-function phy_get_address() {
+phy_get_address() {
        local phy=${1}
        assert isset phy
 
@@ -91,7 +91,7 @@ function phy_get_address() {
        print "$(<${path})"
 }
 
-function phy_get_devices() {
+phy_get_devices() {
        local phy="${1}"
        assert isset phy
 
index e3ea1f619cb387e5e4c25a653d6041b1d86e8df4..39c7fb66fa82e23c601d58d4e3121814d0c52f77 100644 (file)
 #                                                                             #
 ###############################################################################
 
-function port_dir() {
+port_dir() {
        echo "${NETWORK_CONFIG_DIR}/ports"
 }
 
-function port_list() {
+port_list() {
        local port
        for port in $(port_dir)/*; do
                port="$(basename "${port}")"
@@ -33,7 +33,7 @@ function port_list() {
        done
 }
 
-function port_list_in_use() {
+port_list_in_use() {
        local ports_in_use
 
        # Collect all ports that are attached to a zone
@@ -51,7 +51,7 @@ function port_list_in_use() {
        list_sort ${ports_in_use}
 }
 
-function port_list_free() {
+port_list_free() {
        local ports_in_use="$(port_list_in_use)"
 
        local port
@@ -64,21 +64,21 @@ function port_list_free() {
        return ${EXIT_OK}
 }
 
-function port_get_hook() {
+port_get_hook() {
        local port=${1}
        assert isset port
 
        config_get_hook $(port_file ${port})
 }
 
-function port_config_dir() {
+port_config_dir() {
        local port=${1}
 
        print "${RUN_DIR}/ports/${port}"
        return ${EXIT_OK}
 }
 
-function port_settings_read() {
+port_settings_read() {
        local port="${1}"
        assert isset port
 
@@ -91,7 +91,7 @@ function port_settings_read() {
        HOOK="${hook}"
 }
 
-function port_settings_write() {
+port_settings_write() {
        local port="${1}"
        assert isset port
        shift
@@ -105,24 +105,24 @@ function port_settings_write() {
        settings_write "$(port_file "${port}")" ${args}
 }
 
-function ports_get_all() {
+ports_get_all() {
        port_list
 }
 
-function port_file() {
+port_file() {
        local port="${1}"
        assert isset port
 
        echo "$(port_dir)/${port}"
 }
 
-function port_exists() {
+port_exists() {
        local port=${1}
 
        [ -f "${NETWORK_CONFIG_DIR}/ports/${port}" ]
 }
 
-function port_get_hook() {
+port_get_hook() {
        local port=${1}
 
        assert isset port
@@ -130,7 +130,7 @@ function port_get_hook() {
        config_get_hook $(port_file ${port})
 }
 
-function port_is_attached() {
+port_is_attached() {
        local port=${1}
        shift
 
@@ -151,11 +151,11 @@ function port_is_attached() {
        return ${EXIT_ERROR}
 }
 
-function port_is_up() {
+port_is_up() {
        device_is_up $@
 }
 
-function port_new() {
+port_new() {
        #local port=${1}
        #shift
        #
@@ -181,7 +181,7 @@ function port_new() {
        hook_exec port ${hook} new $@
 }
 
-function port_destroy() {
+port_destroy() {
        local port=${1}
 
        assert isset port
@@ -224,11 +224,11 @@ function port_destroy() {
        rm -f $(port_file ${port})
 }
 
-function port_create() {
+port_create() {
        port_cmd "create" $@
 }
 
-function port_remove() {
+port_remove() {
        local port="${1}"
        assert isset port
 
@@ -240,27 +240,27 @@ function port_remove() {
        port_cmd "remove" "${port}"
 }
 
-function port_edit() {
+port_edit() {
        port_cmd edit $@
 }
 
-function port_up() {
+port_up() {
        port_cmd up $@
 }
 
-function port_down() {
+port_down() {
        port_cmd down $@
 }
 
-function port_status() {
+port_status() {
        port_cmd status $@
 }
 
-function port_info() {
+port_info() {
        port_cmd info $@
 }
 
-function port_cmd() {
+port_cmd() {
        local cmd=${1}
        local port=${2}
        shift 2
@@ -275,7 +275,7 @@ function port_cmd() {
        hook_exec port ${hook} ${cmd} ${port} $@
 }
 
-function ports_get() {
+ports_get() {
        local port
        for port in $(port_dir)/*; do
                port=$(basename ${port})
@@ -285,7 +285,7 @@ function ports_get() {
        done
 }
 
-function port_find_free() {
+port_find_free() {
        local pattern=${1}
 
        assert isset pattern
@@ -305,7 +305,7 @@ function port_find_free() {
        return ${EXIT_ERROR}
 }
 
-function port_get_info() {
+port_get_info() {
        local port=${1}
        local key=${2}
 
@@ -319,19 +319,19 @@ function port_get_info() {
        )
 }
 
-function port_get_parents() {
+port_get_parents() {
        local port=${1}
 
        port_get_info ${port} PORT_PARENTS
 }
 
-function port_get_children() {
+port_get_children() {
        local port=${1}
 
        port_get_info ${port} PORT_CHILDREN
 }
 
-function port_zone() {
+port_zone() {
        # Get name of the zones, this port is configured in.
        local port=${1}
        shift
@@ -349,7 +349,7 @@ function port_zone() {
        return ${EXIT_OK}
 }
 
-function port_hotplug_event() {
+port_hotplug_event() {
        local port="${1}"
        assert isset port
 
@@ -358,7 +358,7 @@ function port_hotplug_event() {
        port_cmd "hotplug" "${port}"
 }
 
-function port_get_slaves() {
+port_get_slaves() {
        local port="${1}"
 
        port_settings_read "${port}" \
@@ -366,7 +366,7 @@ function port_get_slaves() {
        print "${SLAVES}"
 }
 
-function port_device_is_slave() {
+port_device_is_slave() {
        assert [ $# -eq 2 ]
 
        local port="${1}"
@@ -379,7 +379,7 @@ function port_device_is_slave() {
        list_match "${device}" ${slaves}
 }
 
-function port_get_phy() {
+port_get_phy() {
        local port="${1}"
 
        port_settings_read "${port}" \
@@ -387,7 +387,7 @@ function port_get_phy() {
        print "${PHY}"
 }
 
-function port_uses_phy() {
+port_uses_phy() {
        assert [ $# -eq 2 ]
 
        local port="${1}"
@@ -404,7 +404,7 @@ function port_uses_phy() {
        [ "${port_phy}" = "${phy}" ]
 }
 
-function ports_lowest_address() {
+ports_lowest_address() {
        local address
        local addresses
 
index 58463d6f73c75b1ebf7a4d6675b6106d14cbb2d4..92ff353685f1fcab29b42513ca41c4a147336f6d 100644 (file)
@@ -26,7 +26,7 @@ EXIT_PPPD_ERROR_FATAL=$(( ${EXIT_ERROR} + 1 ))
 
 # This function monitors the pppd activity.
 
-function pppd_angel() {
+pppd_angel() {
        local device="${1}"
        assert isset device
 
@@ -86,7 +86,7 @@ function pppd_angel() {
        done
 }
 
-function pppd_exec() {
+pppd_exec() {
        local device="${1}"
        assert isset device
 
@@ -229,7 +229,7 @@ function pppd_exec() {
        esac
 }
 
-function pppd_start() {
+pppd_start() {
        local device="${1}"
        assert isset device
 
@@ -238,21 +238,21 @@ function pppd_start() {
        service_start "pppd@${device}.service"
 }
 
-function pppd_stop() {
+pppd_stop() {
        local device="${1}"
        assert isset device
 
        service_stop "pppd@${device}.service"
 }
 
-function pppd_status() {
+pppd_status() {
        local device="${1}"
        assert isset device
 
        service_status "pppd@${device}.service"
 }
 
-function ppp_common_ip_pre_up() {
+ppp_common_ip_pre_up() {
        local zone=${1}
        shift
 
@@ -266,7 +266,7 @@ function ppp_common_ip_pre_up() {
        return ${EXIT_OK}
 }
 
-function ppp_common_ipv4_up() {
+ppp_common_ipv4_up() {
        local zone=${1}
        shift
 
@@ -282,7 +282,7 @@ function ppp_common_ipv4_up() {
        return ${EXIT_OK}
 }
 
-function ppp_common_ipv4_down() {
+ppp_common_ipv4_down() {
        local zone=${1}
        shift
 
@@ -303,7 +303,7 @@ function ppp_common_ipv4_down() {
        return ${EXIT_OK}
 }
 
-function ppp_common_ipv6_up() {
+ppp_common_ipv6_up() {
        local zone=${1}
        shift
 
@@ -322,7 +322,7 @@ function ppp_common_ipv6_up() {
        return ${EXIT_OK}
 }
 
-function ppp_common_ipv6_down() {
+ppp_common_ipv6_down() {
        local zone=${1}
        shift
 
@@ -343,7 +343,7 @@ function ppp_common_ipv6_down() {
        return ${EXIT_OK}
 }
 
-function ppp_secret() {
+ppp_secret() {
        local USER=${1}
        local SECRET=${2}
        local a
@@ -362,7 +362,7 @@ function ppp_secret() {
        rm -f ${PPP_SECRETS}.tmp
 }
 
-function ppp_accounting() {
+ppp_accounting() {
        local zone=${1}
        shift
 
@@ -370,7 +370,7 @@ function ppp_accounting() {
                --rcvd="${BYTES_RCVD}" --sent="${BYTES_SENT}"
 }
 
-function pppd_write_config() {
+pppd_write_config() {
        local file=${1}; shift
        assert isset file
 
index 37c3fdb03c96e84f553dc6911e1ab25db692503a..fe0fc5c46860815e4cae99322927955548bd90f9 100644 (file)
 #                                                                             #
 ###############################################################################
 
-function pppoe_server_start() {
+pppoe_server_start() {
        local zone=${1}
        assert isset zone
 
        service_start "pppoe-server@${zone}.service"
 }
 
-function pppoe_server_stop() {
+pppoe_server_stop() {
        local zone=${1}
        assert isset zone
 
        service_stop "pppoe-server@${zone}.service"
 }
 
-function pppoe_server_status() {
+pppoe_server_status() {
        local zone=${1}
        assert isset zone
 
        service_status "pppoe-server@${zone}.service"
 }
 
-function pppoe_server_options() {
+pppoe_server_options() {
        local file=${1}
        assert isset file
 
@@ -161,7 +161,7 @@ function pppoe_server_options() {
        return ${EXIT_OK}
 }
 
-function pppoe_server_poolfile() {
+pppoe_server_poolfile() {
        local file=${1}
        assert isset file
 
index 7970a54b2f296b489fe6aee8c1fb6296f480cc6d..21fd1e474035a5844d514a635062b54367626827 100644 (file)
@@ -21,7 +21,7 @@
 
 RADVD_CONFIGFILE="/etc/radvd.conf"
 
-function radvd_update() {
+radvd_update() {
        # (Re-)write the configuration file
        radvd_write_config
 
@@ -29,7 +29,7 @@ function radvd_update() {
        service_reload radvd
 }
 
-function radvd_write_config() {
+radvd_write_config() {
        config_header "radv daemon configuration file" > ${RADVD_CONFIGFILE}
 
        # Write the configuration for all zones.
@@ -42,7 +42,7 @@ function radvd_write_config() {
        return ${EXIT_OK}
 }
 
-function __radvd_config_interface() {
+__radvd_config_interface() {
        local zone=${1}
        assert isset zone
 
@@ -104,7 +104,7 @@ function __radvd_config_interface() {
        print
 }
 
-function __radvd_config_dns() {
+__radvd_config_dns() {
        local zone=${1}
 
        # Do nothing, when this option is not enabled.
index d72a1071ef017607bf2d5afb5defa73057b6e2db..1870f9646672134ddc287c57774a9e6faccf34b5 100644 (file)
 # Functions for static routing.
 #
 
-function route_init() {
+route_init() {
        # Apply configured static routes.
        route_apply
 }
 
 init_register route_init
 
-function route_add() {
+route_add() {
        local ${NETWORK_CONFIG_ROUTES_PARAMS}
 
        while [ $# -gt 0 ]; do
@@ -141,7 +141,7 @@ function route_add() {
        return ${EXIT_OK}
 }
 
-function route_remove() {
+route_remove() {
        local _network=${1}
        assert isset _network
 
@@ -173,7 +173,7 @@ function route_remove() {
        return ${EXIT_OK}
 }
 
-function route_list() {
+route_list() {
        local protocol
 
        while [ $# -gt 0 ]; do
@@ -225,7 +225,7 @@ function route_list() {
        done < ${NETWORK_CONFIG_ROUTES}
 }
 
-function route_find_duplicate() {
+route_find_duplicate() {
        local _network=${1}
 
        [ -r "${NETWORK_CONFIG_ROUTES}" ] || return ${EXIT_FALSE}
@@ -243,7 +243,7 @@ function route_find_duplicate() {
        return ${EXIT_FALSE}
 }
 
-function route_parse_line() {
+route_parse_line() {
        local arg
 
        # Reset all possible settings.
@@ -303,7 +303,7 @@ function route_parse_line() {
        return ${EXIT_OK}
 }
 
-function route_apply() {
+route_apply() {
        local table="static"
        local type
 
@@ -341,7 +341,7 @@ function route_apply() {
        route_rule_add --lookup="static" --priority=1000
 }
 
-function route_entry_add() {
+route_entry_add() {
        local gateway
        local network
        local proto
@@ -432,7 +432,7 @@ function route_entry_add() {
        cmd_quiet "${command}"
 }
 
-function route_table_create() {
+route_table_create() {
        local table=${1}
        assert isset table
 
@@ -452,7 +452,7 @@ function route_table_create() {
        return ${EXIT_OK}
 }
 
-function _route_table_next_id() {
+_route_table_next_id() {
        # The Linux kernel is able to manage 255 routing tables (1-255).
        # This function returns the next free id, starting from 255.
        local next_id
@@ -467,7 +467,7 @@ function _route_table_next_id() {
        return ${EXIT_FALSE}
 }
 
-function route_table_flush() {
+route_table_flush() {
        local protocol
        local table
 
@@ -515,7 +515,7 @@ function route_table_flush() {
        return ${EXIT_OK}
 }
 
-function route_table_exists() {
+route_table_exists() {
        local _id _table
 
        while [ $# -gt 0 ]; do
@@ -545,7 +545,7 @@ function route_table_exists() {
        return ${EXIT_FALSE}
 }
 
-function route_rule_add() {
+route_rule_add() {
        local priority
        local protocols=${IP_SUPPORTED_PROTOCOLS}
        local lookup
@@ -608,7 +608,7 @@ function route_rule_add() {
        done
 }
 
-function route_rule_exists() {
+route_rule_exists() {
        local from
        local lookup
        local proto
@@ -669,7 +669,7 @@ function route_rule_exists() {
        return ${EXIT_FALSE}
 }
 
-function _route_rule_exists_parse() {
+_route_rule_exists_parse() {
        # Reset all variables.
        _lookup=
        _from=
index d60b7f76a5fda6fbeeed8bc44346ac28a8d9f3ba..d65506aadf4ca3a8901b89cb060a904307d9d4b3 100644 (file)
 #                                                                             #
 ###############################################################################
 
-function routing_has_default() {
+routing_has_default() {
        ip route | grep -q "^default"
 }
 
-function routing_default_update() {
+routing_default_update() {
        local routes
 
        local zones=$(zones_get_nonlocal)
@@ -105,16 +105,16 @@ function routing_default_update() {
 }
 
 # XXX deprecated function
-function routing_table_exists() {
+routing_table_exists() {
        route_table_exists $@
 }
 
 # XXX deprecated function
-function routing_table_create() {
+routing_table_create() {
        route_table_create $@
 }
 
-function routing_db_path() {
+routing_db_path() {
        local zone=${1}
        local proto=${2}
 
@@ -125,21 +125,21 @@ function routing_db_path() {
        echo "${ROUTING_DB_DIR}/${zone}/${proto}"
 }
 
-function routing_db_exists() {
+routing_db_exists() {
        [ -d "$(routing_db_path $@)" ]
 }
 
-function routing_db_create() {
+routing_db_create() {
        routing_db_exists $@ && return ${EXIT_OK}
 
        mkdir -p $(routing_db_path $@)
 }
 
-function routing_db_remove() {
+routing_db_remove() {
        rm -rf $(routing_db_path $@)
 }
 
-function routing_db_set() {
+routing_db_set() {
        local zone=${1}
        local proto=${2}
        local parameter=${3}
@@ -154,7 +154,7 @@ function routing_db_set() {
        echo "${value}" > $(routing_db_path ${zone} ${proto})/${parameter}
 }
 
-function routing_db_get() {
+routing_db_get() {
        local zone=${1}
        local proto=${2}
        local parameter=${3}
@@ -163,7 +163,7 @@ function routing_db_get() {
        cat $(routing_db_path ${zone} ${proto})/${parameter} 2>/dev/null
 }
 
-function routing_db_from_ppp() {
+routing_db_from_ppp() {
        local zone=${1}
        local proto=${2}
 
@@ -186,7 +186,7 @@ function routing_db_from_ppp() {
        routing_db_set ${zone} ${proto} remote-address ${PPP_MACREMOTE,,}
 }
 
-function routing_update() {
+routing_update() {
        local zone=${1}
        assert isset zone
 
index 170305b300761d2e1def4b9445ae940cd8bb6bf6..db6e48c6d4e7075fed1829d64a98649fa18d0b72 100644 (file)
@@ -22,7 +22,7 @@
 # This is a list of baudrates that are supported.
 SERIAL_BAUDRATES="921600 460800 230400 115200 57600 38400 19200 9600"
 
-function serial_list() {
+serial_list() {
        local device
        for device in /dev/ttyUSB*; do
                if serial_exists "${device}"; then
@@ -31,13 +31,13 @@ function serial_list() {
        done
 }
 
-function serial_exists() {
+serial_exists() {
        local device=${1}
 
        [ -c "${device}" ]
 }
 
-function serial_is_locked() {
+serial_is_locked() {
        local device=${1}
        assert isset device
 
@@ -52,12 +52,12 @@ function serial_is_locked() {
        return ${EXIT_FALSE}
 }
 
-function serial_is_unlocked() {
+serial_is_unlocked() {
        serial_is_locked ${device} \
                && return ${EXIT_FALSE} || return ${EXIT_TRUE}
 }
 
-function serial_is_modem() {
+serial_is_modem() {
        local device=${1}
        assert isset device
 
@@ -77,7 +77,7 @@ function serial_is_modem() {
        esac
 }
 
-function serial_get_bus_type() {
+serial_get_bus_type() {
        local device="${1}"
        assert isset device
 
index 81c0fae4d005ced3bccc0a78ae0be6e2d8e1a92a..7a12ffd5e37401f3fd2bbcce5b5cdd9e358e23fd 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function service_start() {
+service_start() {
        local name=${1}
        assert isset name
 
@@ -40,21 +40,21 @@ function service_start() {
        return ${ret}
 }
 
-function service_stop() {
+service_stop() {
        local name="${1}"
        assert isset name
 
        systemctl stop "${name}"
 }
 
-function service_restart() {
+service_restart() {
        local name="${1}"
        assert isset name
 
        systemctl restart "${name}"
 }
 
-function service_reload() {
+service_reload() {
        local name="${1}"
        assert isset name
 
@@ -66,7 +66,7 @@ function service_reload() {
        fi
 }
 
-function service_status() {
+service_status() {
        local name="${1}"
        assert isset name
 
@@ -77,7 +77,7 @@ function service_status() {
 # This function calls the "enable" command from systemd,
 # to mark services to be automatically started during
 # boot up.
-function service_enable() {
+service_enable() {
        local name="${1}"
        assert isset name
 
@@ -87,7 +87,7 @@ function service_enable() {
 # This function calls the "disable" command of systemd,
 # to drop the autostart ability of the service during the
 # boot up.
-function service_disable() {
+service_disable() {
        local name="${1}"
        assert isset name
 
@@ -96,7 +96,7 @@ function service_disable() {
 
 # This function uses the systemd command "is-enabled" to check,
 # if a service has been enabled or not.
-function service_is_enabled() {
+service_is_enabled() {
        local name="${1}"
        assert isset name
 
@@ -104,7 +104,7 @@ function service_is_enabled() {
        return $?
 }
 
-function service_is_active() {
+service_is_active() {
        local name="${1}"
        assert isset name
 
@@ -112,7 +112,7 @@ function service_is_active() {
        return $?
 }
 
-function service_get_exitcode() {
+service_get_exitcode() {
        local name=${1}
        assert isset name
 
index 9e78858f0f54ab7039bff9d52ae29742d14b44d7..a50042cc64150ecd8c501e951b7dace0b8ed38c8 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function settings_read() {
+settings_read() {
        local file="${1}"
        assert isset file
        shift
@@ -77,7 +77,7 @@ function settings_read() {
        done < ${file}
 }
 
-function settings_read_array() {
+settings_read_array() {
        local file=${1}
        assert isset file
        shift
@@ -119,7 +119,7 @@ function settings_read_array() {
 }
 
 # Strip leading and trailing "s.
-function settings_strip() {
+settings_strip() {
        local var="$@"
 
        # Do nothing for strings that contain spaces.
@@ -131,7 +131,7 @@ function settings_strip() {
        unquote "${var}"
 }
 
-function settings_write() {
+settings_write() {
        local settings_file="${1}"
        assert isset settings_file
        shift
@@ -170,7 +170,7 @@ function settings_write() {
        done
 }
 
-function settings_remove() {
+settings_remove() {
        local settings_file="${1}"
 
        local abspath="$(readlink -e "${settings_file}")"
@@ -182,7 +182,7 @@ function settings_remove() {
        rm -f "${settings_file}"
 }
 
-function settings_print() {
+settings_print() {
        local param
 
        for param in $(listsort $@); do
@@ -190,7 +190,7 @@ function settings_print() {
        done
 }
 
-function settings_check() {
+settings_check() {
        local check_func="${1}"
 
        # Execute the check function
@@ -221,7 +221,7 @@ function settings_check() {
        return ${EXIT_ERROR}
 }
 
-function settings_set() {
+settings_set() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        *=*)
@@ -240,7 +240,7 @@ function settings_set() {
        done
 }
 
-function network_settings_read() {
+network_settings_read() {
        local options="${NETWORK_SETTINGS_FILE_PARAMS}"
 
        # If the DEBUG variable has already been set,
@@ -252,29 +252,29 @@ function network_settings_read() {
        settings_read "${NETWORK_SETTINGS_FILE}" ${options}
 }
 
-function network_settings_write() {
+network_settings_write() {
        settings_write "${NETWORK_SETTINGS_FILE}" ${NETWORK_SETTINGS_FILE_PARAMS}
 
        # Update DNS configuration.
        dns_generate_resolvconf
 }
 
-function network_settings_print() {
+network_settings_print() {
        settings_print ${NETWORK_SETTINGS_FILE_PARAMS}
 }
 
-function network_settings_list() {
+network_settings_list() {
        print "${NETWORK_SETTINGS_FILE_PARAMS}"
 }
 
-function firewall_settings_read() {
+firewall_settings_read() {
        settings_read "${FIREWALL_SETTINGS_FILE}" "${FIREWALL_SETTINGS_PARAMS}"
 }
 
-function firewall_settings_write() {
+firewall_settings_write() {
        settings_write "${FIREWALL_SETTINGS_FILE}" "${FIREWALL_SETTINGS_PARAMS}"
 }
 
-function firewall_settings_print() {
+firewall_settings_print() {
        settings_print "${FIREWALL_SETTINGS_PARAMS}"
 }
index 2dd6f8d0235b793cce4ff3fa9bc29d6bdd642b52..0e6ae3923f6fe1b7b7eb38008d62591ed71922b9 100644 (file)
@@ -28,7 +28,7 @@ STP_DEFAULT_MODE="rstp"
 # Allowed modes of the spanning tree protocol.
 STP_ALLOWED_MODES="rstp stp"
 
-function stp_enable() {
+stp_enable() {
        local bridge=${1}
        assert isset bridge
 
@@ -36,7 +36,7 @@ function stp_enable() {
        print 1 > ${SYS_CLASS_NET}/${bridge}/bridge/stp_state
 }
 
-function stp_disable() {
+stp_disable() {
        local bridge=${1}
        assert isset bridge
 
@@ -44,7 +44,7 @@ function stp_disable() {
        print 0 > ${SYS_CLASS_NET}/${bridge}/bridge/stp_state
 }
 
-function stp_is_enabled() {
+stp_is_enabled() {
        local bridge=${1}
        assert isset bridge
 
@@ -60,7 +60,7 @@ function stp_is_enabled() {
        esac
 }
 
-function stp_is_userspace() {
+stp_is_userspace() {
        local bridge=${1}
        assert isset bridge
 
@@ -75,7 +75,7 @@ function stp_is_userspace() {
        esac
 }
 
-function stp_get_name() {
+stp_get_name() {
        local proto=${1}
 
        case "${proto}" in
@@ -93,7 +93,7 @@ function stp_get_name() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_set_protocol() {
+stp_bridge_set_protocol() {
        local bridge=${1}
        assert isset bridge
 
@@ -111,7 +111,7 @@ function stp_bridge_set_protocol() {
        assert [ $? -eq 0 ]
 }
 
-function stp_bridge_get_protocol() {
+stp_bridge_get_protocol() {
        local bridge=${1}
 
        assert isset bridge
@@ -146,7 +146,7 @@ function stp_bridge_get_protocol() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_get_id() {
+stp_bridge_get_id() {
        local bridge=${1}
        assert isset bridge
 
@@ -155,7 +155,7 @@ function stp_bridge_get_id() {
        return $?
 }
 
-function stp_bridge_get_forward_delay() {
+stp_bridge_get_forward_delay() {
        local bridge=${1}
        assert isset bridge
 
@@ -169,7 +169,7 @@ function stp_bridge_get_forward_delay() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_set_forward_delay() {
+stp_bridge_set_forward_delay() {
        local bridge=${1}
        assert isset bridge
 
@@ -192,7 +192,7 @@ function stp_bridge_set_forward_delay() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_get_hello_time() {
+stp_bridge_get_hello_time() {
        local bridge=${1}
        assert isset bridge
 
@@ -202,7 +202,7 @@ function stp_bridge_get_hello_time() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_set_hello_time() {
+stp_bridge_set_hello_time() {
        local bridge=${1}
        assert isset bridge
 
@@ -220,7 +220,7 @@ function stp_bridge_set_hello_time() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_get_max_age() {
+stp_bridge_get_max_age() {
        local bridge=${1}
        assert isset bridge
 
@@ -230,7 +230,7 @@ function stp_bridge_get_max_age() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_set_max_age() {
+stp_bridge_set_max_age() {
        local bridge=${1}
        assert isset bridge
 
@@ -248,7 +248,7 @@ function stp_bridge_set_max_age() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_get_priority() {
+stp_bridge_get_priority() {
        local bridge=${1}
        assert isset bridge
 
@@ -256,7 +256,7 @@ function stp_bridge_get_priority() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_set_priority() {
+stp_bridge_set_priority() {
        local bridge=${1}
        assert isset bridge
 
@@ -274,7 +274,7 @@ function stp_bridge_set_priority() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_get_designated_root() {
+stp_bridge_get_designated_root() {
        local bridge=${1}
        assert isset bridge
 
@@ -297,7 +297,7 @@ function stp_bridge_get_designated_root() {
        fi
 }
 
-function stp_bridge_get_root_path_cost() {
+stp_bridge_get_root_path_cost() {
        local bridge=${1}
        assert isset bridge
 
@@ -310,7 +310,7 @@ function stp_bridge_get_root_path_cost() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_get_root_port_id() {
+stp_bridge_get_root_port_id() {
        local bridge=${1}
        assert isset bridge
 
@@ -330,7 +330,7 @@ function stp_bridge_get_root_port_id() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_get_root_port() {
+stp_bridge_get_root_port() {
        local bridge=${1}
        assert isset bridge
 
@@ -349,7 +349,7 @@ function stp_bridge_get_root_port() {
        return ${EXIT_ERROR}
 }
 
-function stp_bridge_is_root() {
+stp_bridge_is_root() {
        local bridge=${1}
        assert isset bridge
 
@@ -362,7 +362,7 @@ function stp_bridge_is_root() {
        return ${EXIT_FALSE}
 }
 
-function stp_bridge_get_topology_change_count() {
+stp_bridge_get_topology_change_count() {
        local bridge=${1}
        assert isset bridge
 
@@ -375,7 +375,7 @@ function stp_bridge_get_topology_change_count() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_get_topology_change_timer() {
+stp_bridge_get_topology_change_timer() {
        local bridge=${1}
        assert isset bridge
 
@@ -388,7 +388,7 @@ function stp_bridge_get_topology_change_timer() {
        return ${EXIT_OK}
 }
 
-function stp_bridge_get_topology_change_detected() {
+stp_bridge_get_topology_change_detected() {
        local bridge=${1}
        assert isset bridge
 
@@ -409,7 +409,7 @@ function stp_bridge_get_topology_change_detected() {
        fi
 }
 
-function stp_port_get_state() {
+stp_port_get_state() {
        local bridge=${1}
        assert isset bridge
 
@@ -448,7 +448,7 @@ function stp_port_get_state() {
        return ${EXIT_OK}
 }
 
-function stp_port_get_id() {
+stp_port_get_id() {
        local bridge=${1}
        assert isset bridge
 
@@ -459,7 +459,7 @@ function stp_port_get_id() {
        return ${EXIT_OK}
 }
 
-function stp_port_get_cost() {
+stp_port_get_cost() {
        local bridge=${1}
        assert isset bridge
 
@@ -475,7 +475,7 @@ function stp_port_get_cost() {
        return ${EXIT_ERROR}
 }
 
-function stp_port_set_cost() {
+stp_port_set_cost() {
        assert [ $# -eq 3 ]
 
        local bridge="${1}"
@@ -496,7 +496,7 @@ function stp_port_set_cost() {
        fi
 }
 
-function stp_port_get_designated_root() {
+stp_port_get_designated_root() {
        local bridge=${1}
        assert isset bridge
 
@@ -521,7 +521,7 @@ function stp_port_get_designated_root() {
        return ${EXIT_ERROR}
 }
 
-function __stp_div_100() {
+__stp_div_100() {
        local val=${1}
 
        local split=$((${#val} - 2))
index 79b9ce9bcf4ca1c03334e6fe6de214e474e82770..5d77b8e9f078d04f18de2fb6fdc47f2df89ea539 100644 (file)
@@ -21,7 +21,7 @@
 
 SYSCTL_PATH="/proc/sys"
 
-function sysctl_key_to_path() {
+sysctl_key_to_path() {
        local key="${1}"
        assert isset key
 
@@ -30,7 +30,7 @@ function sysctl_key_to_path() {
        return ${EXIT_OK}
 }
 
-function sysctl_key_exists() {
+sysctl_key_exists() {
        local key="${1}"
        assert isset key
 
@@ -40,7 +40,7 @@ function sysctl_key_exists() {
        return ${EXIT_ERROR}
 }
 
-function sysctl_get() {
+sysctl_get() {
        local key="${1}"
        assert isset key
 
@@ -48,7 +48,7 @@ function sysctl_get() {
        return ${EXIT_OK}
 }
 
-function sysctl_set() {
+sysctl_set() {
        local key="${1}"
        assert isset key
 
@@ -58,7 +58,7 @@ function sysctl_set() {
        return ${EXIT_OK}
 }
 
-function sysctl_set_bool() {
+sysctl_set_bool() {
        local key="${1}"
 
        local value="${2}"
@@ -71,7 +71,7 @@ function sysctl_set_bool() {
        sysctl_set "${key}" "${value}"
 }
 
-function sysctl_set_recursively() {
+sysctl_set_recursively() {
        local basekey="${1}"
        assert isset basekey
 
index 2c6cc00e12328fb55b0758cc42f30af231b98778..47268e5ef50cbda81ab5a7cff82c15c2e914ff66 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-function usb_device_find_by_tty() {
+usb_device_find_by_tty() {
        local tty="${1}"
        assert isset tty
 
@@ -35,7 +35,7 @@ function usb_device_find_by_tty() {
        return ${EXIT_OK}
 }
 
-function usb_device_list_interfaces() {
+usb_device_list_interfaces() {
        local path="${1}"
        assert [ -d "${path}" ]
 
@@ -48,14 +48,14 @@ function usb_device_list_interfaces() {
        return ${EXIT_OK}
 }
 
-function usb_device_get_interface_type() {
+usb_device_get_interface_type() {
        local interface="${1}"
        assert isset interface
 
        fread "${interface}/type"
 }
 
-function usb_device_has_interface_type_interrupt() {
+usb_device_has_interface_type_interrupt() {
        local device="${1}"
        assert isset device
 
index 18a8f18482cf401c9461c813a37ff4dbe5e53fef..aff803a97ea7fa68962c499b8cc42d7a9f22eb3f 100644 (file)
@@ -20,7 +20,7 @@
 ###############################################################################
 
 # A simple print statement
-function print() {
+print() {
        local fmt=${1}; shift
 
        printf -- "${fmt}\n" "$@"
@@ -29,11 +29,11 @@ function print() {
 # The args() function takes a number of arguments like
 #   var1="abc d" var2="abc" var3="abcd e"
 # and splits them into several arguments, devided by newline
-function args() {
+args() {
        echo "$@" | xargs printf "%s\n"
 }
 
-function unquote() {
+unquote() {
        local var="$@"
 
        if [ "${var:0:1}" = "\"" ]; then
@@ -48,11 +48,11 @@ function unquote() {
        print "${var}"
 }
 
-function quote() {
+quote() {
        print "\"%s\"" "$@"
 }
 
-function strip() {
+strip() {
        local value="$@"
 
        # remove leading whitespace characters
@@ -65,43 +65,43 @@ function strip() {
 }
 
 # Print a pretty error message
-function error() {
+error() {
        echo -e " ${CLR_RED_B}ERROR${CLR_RESET}  : $@" >&2
 }
 
-function error_log() {
+error_log() {
        log ERROR "$@"
 }
 
 # Print a pretty warn message
-function warning() {
+warning() {
        echo -e " ${CLR_YELLOW_B}WARNING${CLR_RESET}: $@" >&2
 }
 
-function warning_log() {
+warning_log() {
        log WARNING "$@"
 }
 
 # The next three functions are kept for backwards
 # compatibility. The need to be dropped at some time.
-function listsort() {
+listsort() {
        list_sort $@
 }
 
-function listmatch() {
+listmatch() {
        list_match $@
 }
 
-function listlength() {
+listlength() {
        list_length $@
 }
 
 # Speedup function to avoid a call of the basename binary
-function basename() {
+basename() {
        echo "${1##*/}"
 }
 
-function format() {
+format() {
        local key=${1}
        assert isset key
 
@@ -113,7 +113,7 @@ function format() {
        printf -v "${key}" "${format}" "$@"
 }
 
-function assign() {
+assign() {
        local key=${1}
        assert isset key
        shift
@@ -121,7 +121,7 @@ function assign() {
        format "${key}" "%s" "$@"
 }
 
-function fread() {
+fread() {
        local file=${1}
        assert isset file
 
@@ -130,7 +130,7 @@ function fread() {
        print "$(<${file})"
 }
 
-function fwrite() {
+fwrite() {
        local file=${1}
        assert isset file
        shift
@@ -143,13 +143,13 @@ function fwrite() {
        print "%s" "$@" >> ${file} 2>/dev/null
 }
 
-function enabled() {
+enabled() {
        local param=${1}
 
        list_match "${!param}" yes on true 1
 }
 
-function mac_generate() {
+mac_generate() {
        # Get a bunch of random hex digits
        # and remove all dashes from the input.
        local random=$(</proc/sys/kernel/random/uuid)
@@ -184,7 +184,7 @@ function mac_generate() {
        echo "${output}"
 }
 
-function mac_format() {
+mac_format() {
        local mac=${1}
        assert isset mac
 
@@ -209,54 +209,54 @@ function mac_format() {
        print "${output}"
 }
 
-function mac_is_valid() {
+mac_is_valid() {
        local mac=${1}
 
        [[ ${mac} =~ ^([0-9a-f]{2}\:){5}[0-9a-f]{2}$ ]]
 }
 
-function uuid() {
+uuid() {
        echo $(</proc/sys/kernel/random/uuid)
 }
 
-function isset() {
+isset() {
        local var=${1}
 
        [ -n "${!var}" ]
 }
 
-function isoneof() {
+isoneof() {
        local var=${!1}
        shift
 
        list_match "${var}" "$@"
 }
 
-function isbool() {
+isbool() {
        local var=${1}
 
        isoneof ${var} 0 1 no yes on off
 }
 
-function isinteger() {
+isinteger() {
        local var=${!1}
 
        [[ ${var} =~ ^[0-9]+$ ]]
 }
 
-function ismac() {
+ismac() {
        local mac=${!1}
 
        mac_is_valid ${mac}
 }
 
-function isipaddress() {
+isipaddress() {
        local addr=${!1}
 
        ip_is_valid ${addr}
 }
 
-function backtrace() {
+backtrace() {
        local start=1
 
        echo # Empty line
@@ -279,7 +279,7 @@ function backtrace() {
        done
 }
 
-function assert() {
+assert() {
        local assertion="$@"
 
        if ! ${assertion}; then
@@ -293,7 +293,7 @@ function assert() {
 
 # This function checks, if the given argument is an assert error
 # exit code. If this is the case, the script will halt immediately.
-function assert_check_retval() {
+assert_check_retval() {
        local ret=${1}
 
        if [ ${ret} -eq ${EXIT_ERROR_ASSERT} ]; then
@@ -303,7 +303,7 @@ function assert_check_retval() {
        return ${ret}
 }
 
-function exec_cmd() {
+exec_cmd() {
        local cmd=$@
 
        log DEBUG "Running command: ${cmd}"
@@ -324,7 +324,7 @@ function exec_cmd() {
        return ${ret}
 }
 
-function cmd() {
+cmd() {
        local cmd=$@
 
        log DEBUG "Running command: ${cmd}"
@@ -337,11 +337,11 @@ function cmd() {
        return ${ret}
 }
 
-function cmd_quiet() {
+cmd_quiet() {
        cmd $@ &>/dev/null
 }
 
-function cmd_exec() {
+cmd_exec() {
        local cmd=$@
 
        log DEBUG "Exec'ing command: ${cmd}"
@@ -352,16 +352,16 @@ function cmd_exec() {
        exit ${EXIT_ERROR}
 }
 
-function cmd_not_implemented() {
+cmd_not_implemented() {
        assert false "not implemented"
 }
 
 # Increase security of the read command
-function read() {
+read() {
        builtin read -r $@
 }
 
-function seq() {
+seq() {
        if [ $# -eq 2 ]; then
                eval echo {${1}..${2}}
        elif [ $# -eq 3 ]; then
@@ -369,16 +369,16 @@ function seq() {
        fi
 }
 
-function which() {
+which() {
        type -P $@
 }
 
 # Prints the number of seconds since epoch.
-function timestamp() {
+timestamp() {
        date -u "+%s"
 }
 
-function beautify_time() {
+beautify_time() {
        local value=${1}
 
        local unit
@@ -404,7 +404,7 @@ function beautify_time() {
        echo "${value}${unit}"
 }
 
-function beautify_bytes() {
+beautify_bytes() {
        local value=${1}
 
        local unit
@@ -417,7 +417,7 @@ function beautify_bytes() {
        echo "${value}${unit}"
 }
 
-function module_load() {
+module_load() {
        local module=${1}
 
        if ! grep -q "^${module}" /proc/modules; then
@@ -426,7 +426,7 @@ function module_load() {
        fi
 }
 
-function binary_exists() {
+binary_exists() {
        local binary=${1}
 
        if [ -n "$(type -p ${binary})" ]; then
@@ -436,7 +436,7 @@ function binary_exists() {
        return ${EXIT_ERROR}
 }
 
-function function_exists() {
+function_exists() {
        local function="${1}"
 
        if [ "$(type -t "${function}")" = "function" ]; then
@@ -446,7 +446,7 @@ function function_exists() {
        return ${EXIT_FALSE}
 }
 
-function process_kill() {
+process_kill() {
        local process=${1}
 
        if ! isinteger process; then
@@ -465,7 +465,7 @@ function process_kill() {
        done
 }
 
-function dec() {
+dec() {
        local hex=${1}
 
        if [ "${hex:0:2}" != "0x" ]; then
@@ -475,7 +475,7 @@ function dec() {
        printf "%d\n" "${hex}"
 }
 
-function chr() {
+chr() {
        local char="${1}"
 
        [ ${char} -lt 256 ] || return ${EXIT_ERROR}
@@ -483,20 +483,20 @@ function chr() {
        printf "\\$(( ${char} / 64 * 100 + ${char} % 64 / 8 * 10 + ${char} % 8 ))\n"
 }
 
-function ord() {
+ord() {
        LC_CTYPE="C" printf "%d\n" "'${1}"
 }
 
-function hex() {
+hex() {
        printf "%X\n" "${1}"
 }
 
-function network_is_running() {
+network_is_running() {
        # Check, if the network service is running.
        service_is_active network
 }
 
-function contains_spaces() {
+contains_spaces() {
        local var="$@"
 
        # Eliminate spaces.
@@ -509,7 +509,7 @@ function contains_spaces() {
        return ${EXIT_FALSE}
 }
 
-function string_split() {
+string_split() {
        local string="$@"
 
        local pos=0
@@ -521,7 +521,7 @@ function string_split() {
        return ${EXIT_OK}
 }
 
-function string_reverse() {
+string_reverse() {
        local string="$@"
 
        local output
@@ -535,7 +535,7 @@ function string_reverse() {
        return ${EXIT_OK}
 }
 
-function dec2bin() {
+dec2bin() {
        local number="${1}"
 
        local output
@@ -561,7 +561,7 @@ function dec2bin() {
        print "${output}"
 }
 
-function bin2dec() {
+bin2dec() {
        local string="${1}"
        local number=0
 
@@ -587,31 +587,31 @@ function bin2dec() {
        return ${EXIT_OK}
 }
 
-function char2bin() {
+char2bin() {
        local dec="$(ord "${1}")"
 
        dec2bin "${dec}"
 }
 
-function bin2char() {
+bin2char() {
        local dec="$(bin2dec "$@")"
 
        chr "${dec}"
 }
 
-function bin2hex() {
+bin2hex() {
        local dec="$(bin2dec "$@")"
 
        dec2hex "${dec}"
 }
 
-function hex2bin() {
+hex2bin() {
        local dec="$(hex2dec "$@")"
 
        dec2bin "${dec}"
 }
 
-function hex2dec() {
+hex2dec() {
        local hex="${1}"
 
        # Prepend 0x if necessary.
@@ -620,6 +620,6 @@ function hex2dec() {
        printf "%d\n" "${hex}"
 }
 
-function dec2hex() {
+dec2hex() {
        printf "%02x\n" "${1}"
 }
index 8bcf169df8846eccab4ac1db66164c13b23eb078..97028b0a36514e2c6a1fd33f547121978e6748d3 100644 (file)
@@ -24,7 +24,7 @@ PROC_NET_VLAN_CONFIG="${PROC_NET_VLAN}/config"
 
 VLAN_PORT_INTERFIX="v"
 
-function vlan_init() {
+vlan_init() {
        ebtables-restore <<EOF
 *filter
 :INPUT ACCEPT
@@ -37,7 +37,7 @@ function vlan_init() {
 EOF
 }
 
-function vlan_create() {
+vlan_create() {
        local device=${1}
        assert isset device
 
@@ -87,7 +87,7 @@ function vlan_create() {
        return ${ret}
 }
 
-function vlan_remove() {
+vlan_remove() {
        local device=${1}
        assert isset device
 
@@ -97,7 +97,7 @@ function vlan_remove() {
        device_delete ${device}
 }
 
-function vlan_get_parent() {
+vlan_get_parent() {
        local device=${1}
        assert isset device
 
@@ -115,7 +115,7 @@ function vlan_get_parent() {
        return ${EXIT_ERROR}
 }
 
-function vlan_get_id() {
+vlan_get_id() {
        local device=${1}
        assert isset device
 
@@ -133,7 +133,7 @@ function vlan_get_id() {
        return ${EXIT_ERROR}
 }
 
-function vlan_get_by_parent_and_vid() {
+vlan_get_by_parent_and_vid() {
        local parent=${1}
        assert isset parent
 
index eb7b0a7aa7524387fac35cb155928eaa2c7c4f6e..92519f0482b50939a71ee7cff95f9fbf41f4a0b9 100644 (file)
@@ -23,7 +23,7 @@
 WIRELESS_REGULATORY_DOMAIN="00"
 NETWORK_SETTINGS_FILE_PARAMS="${NETWORK_SETTINGS_FILE_PARAMS} WIRELESS_REGULATORY_DOMAIN"
 
-function wireless_create() {
+wireless_create() {
        local device=${1}
        assert isset device
        shift
@@ -75,7 +75,7 @@ function wireless_create() {
        return ${ret}
 }
 
-function wireless_remove() {
+wireless_remove() {
        local device=${1}
        assert isset device
 
@@ -99,19 +99,19 @@ function wireless_remove() {
        return ${ret}
 }
 
-function wireless_get_reg_domain() {
+wireless_get_reg_domain() {
        # Returns the country code for the wireless device.
        # Defaults to 00 = world if unset.
        print "${WIRELESS_REGULATORY_DOMAIN:-00}"
 }
 
-function wireless_init_reg_domain() {
+wireless_init_reg_domain() {
        local country_code="$(wireless_get_reg_domain)"
 
        wireless_set_reg_domain "${country_code}" --no-reset
 }
 
-function wireless_set_reg_domain() {
+wireless_set_reg_domain() {
        local country_code
        local reset="true"
 
@@ -141,7 +141,7 @@ function wireless_set_reg_domain() {
        iw reg set "${country_code}"
 }
 
-function wireless_channel_to_frequency() {
+wireless_channel_to_frequency() {
        # http://en.wikipedia.org/wiki/List_of_WLAN_channels
 
        local channel=${1}
@@ -173,7 +173,7 @@ function wireless_channel_to_frequency() {
        return ${EXIT_ERROR}
 }
 
-function wireless_set_channel() {
+wireless_set_channel() {
        local device=${1}
        assert isset device
 
@@ -186,7 +186,7 @@ function wireless_set_channel() {
        cmd_quiet iw dev ${device} set channel ${channel}
 }
 
-function wireless_ibss_join() {
+wireless_ibss_join() {
        local device=${1}
        assert isset device
        shift
@@ -229,7 +229,7 @@ function wireless_ibss_join() {
                "${frequency}" fixed-freq "${bssid}"
 }
 
-function wireless_ibss_leave() {
+wireless_ibss_leave() {
        local device=${1}
        assert isset device
 
@@ -237,14 +237,14 @@ function wireless_ibss_leave() {
        cmd_quiet iw dev "${device}" ibss leave
 }
 
-function wireless_is_radar_frequency() {
+wireless_is_radar_frequency() {
        local frequency="${1}"
        assert isset frequency
 
        [[ ${frequency} -ge 5260 ]] && [[ ${frequency} -le 5700 ]]
 }
 
-function wireless_monitor() {
+wireless_monitor() {
        local device="${1}"
        assert isset device
        shift
index b2357d59d5a6ce50678ac9a911c7adbdd5086c6a..9450112759e14d8df75daa99a1ddb89f23941c3f 100644 (file)
@@ -21,7 +21,7 @@
 
 WPA_SUPPLICANT_SOCKET_DIR="${RUN_DIR}/wpa_supplicant/ctrl"
 
-function wpa_supplicant_config_write() {
+wpa_supplicant_config_write() {
        local device=${1}
        assert isset device
 
@@ -180,28 +180,28 @@ function wpa_supplicant_config_write() {
        return ${EXIT_OK}
 }
 
-function wpa_supplicant_config_dir() {
+wpa_supplicant_config_dir() {
        local device=${1}
        assert isset device
 
        echo "${RUN_DIR}/wpa_supplicant/${device}"
 }
 
-function wpa_supplicant_start() {
+wpa_supplicant_start() {
        local device=${1}
        assert isset device
 
        service_start "wpa_supplicant@${device}.service"
 }
 
-function wpa_supplicant_stop() {
+wpa_supplicant_stop() {
        local device=${1}
        assert isset device
 
        service_stop "wpa_supplicant@${device}.service"
 }
 
-function wpa_supplicant_client() {
+wpa_supplicant_client() {
        local device=${1}
        assert isset device
        shift
@@ -213,14 +213,14 @@ function wpa_supplicant_client() {
        cmd wpa_cli -p${WPA_SUPPLICANT_SOCKET_DIR} -i${device} ${cmd}
 }
 
-function wpa_cli_status() {
+wpa_cli_status() {
        local device=${1}
        assert isset device
 
        wpa_supplicant_client ${device} status verbose
 }
 
-function wpa_cli_status_get() {
+wpa_cli_status_get() {
        local device=${1}
        assert isset device
 
@@ -240,7 +240,7 @@ function wpa_cli_status_get() {
        return ${EXIT_ERROR}
 }
 
-function wpa_cli_bss() {
+wpa_cli_bss() {
        local device=${1}
        assert isset device
 
@@ -250,7 +250,7 @@ function wpa_cli_bss() {
        wpa_supplicant_client ${device} bss ${bss}
 }
 
-function wpa_cli_bss_get() {
+wpa_cli_bss_get() {
        local device=${1}
        assert isset device
 
@@ -273,7 +273,7 @@ function wpa_cli_bss_get() {
        return ${EXIT_ERROR}
 }
 
-function wpa_cli_bss_get_frequency() {
+wpa_cli_bss_get_frequency() {
        local device=${1}
        assert isset device
 
@@ -283,7 +283,7 @@ function wpa_cli_bss_get_frequency() {
        wpa_cli_bss_get ${device} ${bssid} freq
 }
 
-function wpa_cli_bss_get_noise() {
+wpa_cli_bss_get_noise() {
        local device=${1}
        assert isset device
 
@@ -293,7 +293,7 @@ function wpa_cli_bss_get_noise() {
        wpa_cli_bss_get ${device} ${bssid} noise
 }
 
-function wpa_cli_bss_get_quality() {
+wpa_cli_bss_get_quality() {
        local device=${1}
        assert isset device
 
@@ -303,7 +303,7 @@ function wpa_cli_bss_get_quality() {
        wpa_cli_bss_get ${device} ${bssid} qual
 }
 
-function wpa_cli_bss_get_flags() {
+wpa_cli_bss_get_flags() {
        local device=${1}
        assert isset device
 
index 4874f388dad7ac3584603316c32384fa4f724e21..a41585a9fbde9cded4c0b27e3347b340a99b962b 100644 (file)
 #                                                                             #
 ###############################################################################
 
-function zone_dir() {
+zone_dir() {
        local zone=${1}
 
        echo "${NETWORK_ZONE_DIR}/zones/${zone}"
 }
 
-function zone_exists() {
+zone_exists() {
        local zone=${1}
        assert isset zone
 
        [ -d "$(zone_dir ${zone})" ]
 }
 
-function zone_match() {
+zone_match() {
        local match
 
        local i
@@ -43,7 +43,7 @@ function zone_match() {
        echo "${match:1:${#match}}"
 }
 
-function zone_name_is_valid() {
+zone_name_is_valid() {
        local zone=${1}
 
        # Don't accept empty strings.
@@ -52,26 +52,26 @@ function zone_name_is_valid() {
        [[ ${zone} =~ $(zone_match) ]]
 }
 
-function zone_is_local() {
+zone_is_local() {
        local zone=${1}
 
        [[ "${zone:0:${#ZONE_LOCAL}}" = "${ZONE_LOCAL}" ]]
 }
 
-function zone_is_nonlocal() {
+zone_is_nonlocal() {
        local zone=${1}
 
        [[ "${zone:0:${#ZONE_NONLOCAL}}" = "${ZONE_NONLOCAL}" ]]
 }
 
-function zone_get_hook() {
+zone_get_hook() {
        local zone=${1}
        assert isset zone
 
        config_get_hook $(zone_dir ${zone})/settings
 }
 
-function zone_start() {
+zone_start() {
        # This function will bring up the zone
        # 'asynchronously' with help of systemd.
 
@@ -81,7 +81,7 @@ function zone_start() {
        service_start "network@${zone}.service"
 }
 
-function zone_start_auto() {
+zone_start_auto() {
        local zone="${1}"
        assert zone_exists "${zone}"
 
@@ -103,7 +103,7 @@ function zone_start_auto() {
        return ${EXIT_OK}
 }
 
-function zone_stop() {
+zone_stop() {
        # This function will bring down the zone
        # 'asynchronously' with help of systemd.
 
@@ -113,14 +113,14 @@ function zone_stop() {
        service_stop "network@${zone}.service"
 }
 
-function zone_reload() {
+zone_reload() {
        local zone="${1}"
        assert zone_exists "${zone}"
 
        service_reload "network@${zone}.service"
 }
 
-function zone_hotplug_event() {
+zone_hotplug_event() {
        local zone="${1}"
        assert isset zone
 
@@ -129,7 +129,7 @@ function zone_hotplug_event() {
        zone_cmd "hotplug" "${zone}"
 }
 
-function zone_enable() {
+zone_enable() {
        # This function will enable the zone
        # with help of systemd.
 
@@ -149,7 +149,7 @@ function zone_enable() {
        return ${ret}
 }
 
-function zone_disable() {
+zone_disable() {
        # This function will disable the zone
        # with help of systemd.
 
@@ -169,7 +169,7 @@ function zone_disable() {
        return ${ret}
 }
 
-function zone_is_enabled() {
+zone_is_enabled() {
        local zone="${1}"
        assert isset zone
 
@@ -181,7 +181,7 @@ function zone_is_enabled() {
        return ${EXIT_FALSE}
 }
 
-function zone_is_active() {
+zone_is_active() {
        local zone="${1}"
        assert isset zone
 
@@ -192,14 +192,14 @@ function zone_is_active() {
        return ${EXIT_FALSE}
 }
 
-function zone_is_enabled_or_active() {
+zone_is_enabled_or_active() {
        local zone="${1}"
        assert isset zone
 
        zone_is_enabled "${zone}" || zone_is_active "${zone}"
 }
 
-function zone_cmd() {
+zone_cmd() {
        local cmd="${1}"
        local port="${2}"
        shift 2
@@ -213,7 +213,7 @@ function zone_cmd() {
        hook_exec zone "${hook}" "${cmd}" "${zone}" $@
 }
 
-function zone_new() {
+zone_new() {
        local zone=${1}
        local hook=${2}
        shift 2
@@ -255,7 +255,7 @@ function zone_new() {
        zone_start "${zone}"
 }
 
-function zone_edit() {
+zone_edit() {
        local zone=${1}
        shift
 
@@ -285,7 +285,7 @@ function zone_edit() {
 }
 
 
-function zone_destroy() {
+zone_destroy() {
        local zone="${1}"
        assert zone_exists "${zone}"
 
@@ -295,7 +295,7 @@ function zone_destroy() {
        log INFO "Zone '${zone}' has been tagged for removal."
 }
 
-function zone_has_destroy_tag() {
+zone_has_destroy_tag() {
        local zone="${1}"
        assert zone_exists "${zone}"
 
@@ -305,7 +305,7 @@ function zone_has_destroy_tag() {
 # This function will remove the given zone
 # RIGHT NOW. Use zone_destroy to remove it
 # at the next status change.
-function zone_destroy_now() {
+zone_destroy_now() {
        local zone="${1}"
        assert zone_exists "${zone}"
 
@@ -320,7 +320,7 @@ function zone_destroy_now() {
        rm -rf "$(zone_dir "${zone}")"
 }
 
-function zone_up() {
+zone_up() {
        local zone=${1}
        shift
 
@@ -353,7 +353,7 @@ function zone_up() {
        zone_db ${zone} started
 }
 
-function zone_down() {
+zone_down() {
        local zone=${1}
        shift
 
@@ -385,7 +385,7 @@ function zone_down() {
        fi
 }
 
-function zone_status() {
+zone_status() {
        local zone="${1}"
        assert isset zone
        shift
@@ -414,7 +414,7 @@ function zone_status() {
        fi
 }
 
-function zone_get_ports() {
+zone_get_ports() {
        local zone=${1}
 
        assert isset zone
@@ -429,7 +429,7 @@ function zone_get_ports() {
        done
 }
 
-function zone_get_ports_num() {
+zone_get_ports_num() {
        local zone="${1}"
        assert isset zone
 
@@ -447,7 +447,7 @@ function zone_get_ports_num() {
        return ${EXIT_OK}
 }
 
-function zone_has_port() {
+zone_has_port() {
        # Check, if the given port is configured
        # in this zone.
 
@@ -461,7 +461,7 @@ function zone_has_port() {
        [ -e "$(zone_dir ${zone})/ports/${port}" ]
 }
 
-function zone_config() {
+zone_config() {
        local zone="${1}"
        local cmd="${2}"
        shift 2
@@ -488,7 +488,7 @@ function zone_config() {
        esac
 }
 
-function zone_config_cmd() {
+zone_config_cmd() {
        assert [ $# -gt 2 ]
 
        local cmd="${1}"
@@ -501,23 +501,23 @@ function zone_config_cmd() {
        hook_zone_exec "${hook}" "config_${cmd}" "${zone}" "$@"
 }
 
-function zone_config_create() {
+zone_config_create() {
        zone_config_cmd "create" "$@"
 }
 
-function zone_config_edit() {
+zone_config_edit() {
        zone_config_cmd "edit" "$@"
 }
 
-function zone_config_remove() {
+zone_config_remove() {
        zone_config_cmd "remove" "$@"
 }
 
-function zone_config_show() {
+zone_config_show() {
        zone_config_cmd "show" "$@"
 }
 
-function zone_show() {
+zone_show() {
        local zone=${1}
 
        echo "${zone}"
@@ -525,7 +525,7 @@ function zone_show() {
        echo
 }
 
-function zones_show() {
+zones_show() {
        local zone
 
        for zone in $(zones_get $@); do
@@ -533,7 +533,7 @@ function zones_show() {
        done
 }
 
-function zones_get_all() {
+zones_get_all() {
        local zone
        for zone in $(zone_dir)/*; do
                zone=$(basename ${zone})
@@ -543,21 +543,21 @@ function zones_get_all() {
        done
 }
 
-function zones_get_local() {
+zones_get_local() {
        local zone
        for zone in $(zones_get_all); do
                zone_is_local ${zone} && echo "${zone}"
        done
 }
 
-function zones_get_nonlocal() {
+zones_get_nonlocal() {
        local zone
        for zone in $(zones_get_all); do
                zone_is_nonlocal ${zone} && echo "${zone}"
        done
 }
 
-function zones_get() {
+zones_get() {
        local local=1
        local remote=1
 
@@ -605,7 +605,7 @@ function zones_get() {
        fi
 }
 
-function zone_ports_list() {
+zone_ports_list() {
        local zone=${1}
 
        local port
@@ -616,7 +616,7 @@ function zone_ports_list() {
        done
 }
 
-function zone_port_attach() {
+zone_port_attach() {
        local zone="${1}"
        assert isset zone
 
@@ -661,7 +661,7 @@ function zone_port_attach() {
        return ${ret}
 }
 
-function zone_port_edit() {
+zone_port_edit() {
        local zone="${1}"
        assert isset zone
 
@@ -688,7 +688,7 @@ function zone_port_edit() {
        hook_zone_exec "${hook}" "port_edit" "${zone}" "${port}" "$@"
 }
 
-function zone_port_detach() {
+zone_port_detach() {
        local zone="${1}"
        assert isset zone
 
@@ -724,7 +724,7 @@ function zone_port_detach() {
        return ${ret}
 }
 
-function zone_port_cmd() {
+zone_port_cmd() {
        local cmd="${1}"
        assert isset cmd
 
@@ -743,19 +743,19 @@ function zone_port_cmd() {
        hook_zone_exec "${hook}" "${cmd}" "${zone}" "${port}" $@
 }
 
-function zone_port_create() {
+zone_port_create() {
        zone_port_cmd "port_create" $@
 }
 
-function zone_port_remove() {
+zone_port_remove() {
        zone_port_cmd "port_remove" $@
 }
 
-function zone_port_up() {
+zone_port_up() {
        zone_port_cmd "port_up" $@
 }
 
-function zone_port_down() {
+zone_port_down() {
        zone_port_cmd "port_down" $@
 }
 
@@ -766,7 +766,7 @@ function zone_port_down() {
 # and therefore do not dispatch a hotplug event when
 # port_create is called.
 
-function zone_port_start() {
+zone_port_start() {
        local zone="${1}"
        local port="${2}"
 
@@ -783,7 +783,7 @@ function zone_port_start() {
        return ${EXIT_OK}
 }
 
-function zone_port_stop() {
+zone_port_stop() {
        local zone="${1}"
        local port="${2}"
 
@@ -796,11 +796,11 @@ function zone_port_stop() {
        zone_port_remove "${zone}" "${port}"
 }
 
-function zone_port_status() {
+zone_port_status() {
        zone_port_cmd "port_status" $@
 }
 
-function zone_ports_cmd() {
+zone_ports_cmd() {
        local cmd="${1}"
        assert isset cmd
 
@@ -817,27 +817,27 @@ function zone_ports_cmd() {
        done
 }
 
-function zone_ports_create() {
+zone_ports_create() {
        zone_ports_cmd "port_create" $@
 }
 
-function zone_ports_remove() {
+zone_ports_remove() {
        zone_ports_cmd "port_remove" $@
 }
 
-function zone_ports_up() {
+zone_ports_up() {
        zone_ports_cmd "port_up" $@
 }
 
-function zone_ports_down() {
+zone_ports_down() {
        zone_ports_cmd "port_down" $@
 }
 
-function zone_ports_status() {
+zone_ports_status() {
        zone_ports_cmd "port_status" $@
 }
 
-function zone_configs_cmd() {
+zone_configs_cmd() {
        assert [ $# -ge 2 ]
 
        local cmd="${1}"
@@ -855,19 +855,19 @@ function zone_configs_cmd() {
        done
 }
 
-function zone_configs_up() {
+zone_configs_up() {
        zone_configs_cmd "up" $@
 }
 
-function zone_configs_down() {
+zone_configs_down() {
        zone_configs_cmd "down" $@
 }
 
-function zone_configs_status() {
+zone_configs_status() {
        zone_configs_cmd "status" $@
 }
 
-function zone_configs_list() {
+zone_configs_list() {
        local zone=${1}
 
        local config
@@ -878,7 +878,7 @@ function zone_configs_list() {
        done
 }
 
-function zone_config_get_hook() {
+zone_config_get_hook() {
        assert [ $# -eq 2 ]
 
        local zone="${1}"
@@ -894,11 +894,11 @@ function zone_config_get_hook() {
        print "${HOOK}"
 }
 
-function zone_has_ip() {
+zone_has_ip() {
        device_has_ip $@
 }
 
-function zone_db() {
+zone_db() {
        local zone=${1}
        local action=${2}
        shift 2
@@ -910,17 +910,17 @@ function zone_db() {
        esac
 }
 
-function zone_is_up() {
+zone_is_up() {
        local zone=${1}
 
        device_is_up ${zone}
 }
 
-function zone_is_down() {
+zone_is_down() {
        ! zone_is_up $@
 }
 
-function zone_get_supported_port_hooks() {
+zone_get_supported_port_hooks() {
        local zone=${1}
 
        local hook=$(zone_get_hook ${zone})
@@ -928,11 +928,11 @@ function zone_get_supported_port_hooks() {
        hook_zone_ports_get_all ${hook}
 }
 
-function zone_get_supported_config_hooks() {
+zone_get_supported_config_hooks() {
        hook_config_get_all
 }
 
-function zone_file() {
+zone_file() {
        local zone=${1}
 
        assert isset zone
@@ -940,7 +940,7 @@ function zone_file() {
        echo "$(zone_dir ${zone})/settings"
 }
 
-function zone_settings_read() {
+zone_settings_read() {
        local zone=${1}
        assert isset zone
        shift
@@ -961,7 +961,7 @@ function zone_settings_read() {
        HOOK="${hook}"
 }
 
-function zone_settings_write() {
+zone_settings_write() {
        local zone="${1}"
        assert isset zone
 
@@ -974,7 +974,7 @@ function zone_settings_write() {
        settings_write "$(zone_file ${zone})" ${args}
 }
 
-function zone_settings_set() {
+zone_settings_set() {
        local zone=${1}
        shift
        local args="$@"
@@ -992,7 +992,7 @@ function zone_settings_set() {
        )
 }
 
-function zone_settings_get() {
+zone_settings_get() {
        local zone=${1}
        local key=${2}
 
@@ -1007,7 +1007,7 @@ function zone_settings_get() {
        )
 }
 
-function zone_config_settings_read() {
+zone_config_settings_read() {
        assert [ $# -ge 2 ]
 
        local zone="${1}"
@@ -1025,7 +1025,7 @@ function zone_config_settings_read() {
        settings_read "${path}" ${args}
 }
 
-function zone_config_settings_write() {
+zone_config_settings_write() {
        assert [ $# -ge 2 ]
 
        local zone="${1}"
@@ -1042,7 +1042,7 @@ function zone_config_settings_write() {
        settings_write "${path}" ${args}
 }
 
-function zone_port_settings_read() {
+zone_port_settings_read() {
        assert [ $# -ge 2 ]
 
        local zone="${1}"
@@ -1060,7 +1060,7 @@ function zone_port_settings_read() {
        settings_read "${path}" ${args}
 }
 
-function zone_port_settings_write() {
+zone_port_settings_write() {
        assert [ $# -ge 2 ]
 
        local zone="${1}"
@@ -1077,7 +1077,7 @@ function zone_port_settings_write() {
        settings_write "${path}" ${args}
 }
 
-function zone_port_settings_remove() {
+zone_port_settings_remove() {
        assert [ $# -eq 2 ]
 
        local zone="${1}"
index 80ff69400a74b2045c589ace7bc9f17bad699480..0a9dc08385deecf1e9d0a4c051d87c580458b613 100644 (file)
@@ -25,7 +25,7 @@ INFO_SETTINGS="HOOK PORT_PARENTS PORT_CHILDREN"
 # into the system and got its correct name.
 # The function is intended to create child ports and things
 # like that.
-function hook_hotplug() {
+hook_hotplug() {
        # If the hook does not handle the hotplug event, it
        # must return EXIT_NOT_HANDLED.
        exit ${EXIT_NOT_HANDLED}
@@ -36,15 +36,15 @@ function hook_hotplug() {
 # The first argument is the port which should be tested
 # against the second argument which is the device that
 # has been plugged in.
-function hook_hotplug_rename() {
+hook_hotplug_rename() {
        exit ${EXIT_FALSE}
 }
 
-function hook_add() {
+hook_add() {
        cmd_not_implemented
 }
 
-function hook_info() {
+hook_info() {
        local port="${1}"
        assert isset port
        shift
@@ -65,7 +65,7 @@ function hook_info() {
        exit ${ERROR_OK}
 }
 
-function hook_status() {
+hook_status() {
        local port="${1}"
        assert isset port
 
@@ -75,17 +75,17 @@ function hook_status() {
 
 # Create any virtual devices, but don't bring them up
 # Must tolerate that the device may already exist
-function hook_create() {
+hook_create() {
        cmd_not_implemented
 }
 
 # Must tolerate that the device may not exist
-function hook_remove() {
+hook_remove() {
        cmd_not_implemented
 }
 
 # Just bring up the device
-function hook_default_up() {
+hook_default_up() {
        local port="${1}"
        assert isset port
 
@@ -104,11 +104,11 @@ function hook_default_up() {
        done
 }
 
-function hook_up() {
+hook_up() {
        hook_default_up $@
 }
 
-function hook_default_down() {
+hook_default_down() {
        local port="${1}"
        assert isset port
 
@@ -123,6 +123,6 @@ function hook_default_down() {
        done
 }
 
-function hook_down() {
+hook_down() {
        hook_default_down $@
 }
index 9a25c0ebab4a854cb16b58d70a74b9da7b2f3fe8..e9b7c91389d4e96b4bfa9b151df70dbe92bfa0f4 100644 (file)
 #                                                                             #
 ###############################################################################
 
-function hook_info() {
+hook_info() {
        echo "HOOK=\"${HOOK}\""
 }
 
-function hook_hotplug() {
+hook_hotplug() {
        # If the hook does not handle the hotplug event, it
        # must return EXIT_NOT_HANDLED.
        exit ${EXIT_NOT_HANDLED}
 }
 
-function hook_new() {
+hook_new() {
        local zone="${1}"
        assert isset zone
        shift
@@ -43,15 +43,15 @@ function hook_new() {
        exit ${EXIT_OK}
 }
 
-function hook_edit() {
+hook_edit() {
        hook_new $@
 }
 
-function hook_remove() {
+hook_remove() {
        cmd_not_implemented
 }
 
-function hook_status() {
+hook_status() {
        local zone="${1}"
        assert isset zone
 
@@ -62,25 +62,25 @@ function hook_status() {
        exit ${STATUS_DOWN}
 }
 
-function hook_up() {
+hook_up() {
        cmd_not_implemented
 }
 
-function hook_down() {
+hook_down() {
        cmd_not_implemented
 }
 
-function hook_discover() {
+hook_discover() {
        # This hook does not support a discovery
        exit ${DISCOVER_NOT_SUPPORTED}
 }
 
 # Do nothing
-function hook_parse_cmdline() {
+hook_parse_cmdline() {
        return ${EXIT_OK}
 }
 
-function hook_port() {
+hook_port() {
        local zone="${1}"
        assert isset zone
 
@@ -102,23 +102,23 @@ function hook_port() {
        exit ${ret}
 }
 
-function hook_port_attach() {
+hook_port_attach() {
        return ${EXIT_NOT_SUPPORTED}
 }
 
-function hook_port_detach() {
+hook_port_detach() {
        return ${EXIT_NOT_SUPPORTED}
 }
 
-function hook_port_edit() {
+hook_port_edit() {
        return ${EXIT_NOT_SUPPORTED}
 }
 
-function hook_port_status() {
+hook_port_status() {
        return ${EXIT_NOT_SUPPORTED}
 }
 
-function hook_default_port_create() {
+hook_default_port_create() {
        assert [ $# -ge 2 ]
 
        local zone="${1}"
@@ -127,11 +127,11 @@ function hook_default_port_create() {
        port_create "${port}"
 }
 
-function hook_port_create() {
+hook_port_create() {
        hook_default_port_create $@
 }
 
-function hook_default_port_remove() {
+hook_default_port_remove() {
        assert [ $# -ge 2 ]
 
        local zone="${1}"
@@ -140,19 +140,19 @@ function hook_default_port_remove() {
        port_remove "${port}"
 }
 
-function hook_port_remove() {
+hook_port_remove() {
        hook_default_port_remove $@
 }
 
-function hook_port_up() {
+hook_port_up() {
        cmd_not_implemented
 }
 
-function hook_port_down() {
+hook_port_down() {
        cmd_not_implemented
 }
 
-function hook_config() {
+hook_config() {
        local zone="${1}"
        assert isset zone
 
@@ -173,7 +173,7 @@ function hook_config() {
        esac
 }
 
-function hook_config_cmd() {
+hook_config_cmd() {
        local cmd="${1}"
        assert isset cmd
 
@@ -199,31 +199,31 @@ function hook_config_cmd() {
        hook_config_exec "${hook_config}" "${cmd}" "${zone}" "$@"
 }
 
-function hook_config_create() {
+hook_config_create() {
        assert [ $# -ge 2 ]
 
        hook_config_cmd "create" "$@"
 }
 
-function hook_config_edit() {
+hook_config_edit() {
        hook_config_cmd "edit" "$@"
 }
 
-function hook_config_remove() {
+hook_config_remove() {
        hook_config_cmd "remove" "$@"
 }
 
-function hook_config_show() {
+hook_config_show() {
        cmd_not_implemented
 }
 
-function hook_ppp_write_config() {
+hook_ppp_write_config() {
        cmd_not_implemented
 
        # Arguments: <zone> <filename>
 }
 
-function hook_ppp_ip_pre_up() {
+hook_ppp_ip_pre_up() {
        local zone="${1}"
        assert isset zone
        shift
@@ -237,7 +237,7 @@ function hook_ppp_ip_pre_up() {
        exit $?
 }
 
-function hook_ppp_ipv4_up() {
+hook_ppp_ipv4_up() {
        local zone="${1}"
        assert isset zone
        shift
@@ -251,7 +251,7 @@ function hook_ppp_ipv4_up() {
        exit $?
 }
 
-function hook_ppp_ipv4_down() {
+hook_ppp_ipv4_down() {
        local zone="${1}"
        assert isset zone
        shift
@@ -265,7 +265,7 @@ function hook_ppp_ipv4_down() {
        exit $?
 }
 
-function hook_ppp_ipv6_up() {
+hook_ppp_ipv6_up() {
        local zone="${1}"
        assert isset zone
        shift
@@ -279,7 +279,7 @@ function hook_ppp_ipv6_up() {
        exit $?
 }
 
-function hook_ppp_ipv6_down() {
+hook_ppp_ipv6_down() {
        local zone="${1}"
        assert isset zone
        shift
index 678bf919b812c7496b54862d82eada85fe8dac49..4c214766568e434ae5415976d8087216ba94859f 100644 (file)
@@ -24,7 +24,7 @@
 # Read network settings
 network_settings_read
 
-function main() {
+main() {
        local zone="${1}"
        assert isset zone
 
index b24cb11c0cd62949cae07251b933ca03fa4a1fa5..ea78d0969b49a27be0761f26beb289821a53f2ba 100644 (file)
@@ -26,12 +26,12 @@ HOOK_SETTINGS="HOOK DELAY"
 # Default settings.
 DELAY=0
 
-function hook_check() {
+hook_check() {
        assert isset DELAY
        assert isinteger DELAY
 }
 
-function hook_create() {
+hook_create() {
        local zone=${1}
        shift
 
@@ -49,7 +49,7 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_up() {
+hook_up() {
        local zone=${1}
        local config=${2}
        shift 2
@@ -65,7 +65,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone=${1}
        local config=${2}
        shift 2
@@ -81,7 +81,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone=${1}
        local config=${2}
        shift 2
index 6ffb0bcf1ee6ea728269a931fe2d56e15ed504e3..f8a21b83dac299c31673907c28c2f31554608945 100644 (file)
@@ -25,7 +25,7 @@ HOOK_MANPAGE="network-config-ipv4-static"
 
 HOOK_SETTINGS="HOOK ADDRESS PREFIX GATEWAY"
 
-function hook_check() {
+hook_check() {
        assert isset ADDRESS
        assert isinteger PREFIX
 
@@ -35,7 +35,7 @@ function hook_check() {
        fi
 }
 
-function hook_create() {
+hook_create() {
        local zone="${1}"
        assert zone_exists "${zone}"
        shift
@@ -112,7 +112,7 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_up() {
+hook_up() {
        local zone=${1}
        local config=${2}
        shift 2
@@ -138,7 +138,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone=${1}
        local config=${2}
        shift 2
@@ -158,7 +158,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone="${1}"
        assert isset zone
 
index 6cb5ed305bc832c8bcd28ad6e4260f82d7e3b10b..b2c398f127c9e5c543d97ce5d9511617bb0e9ec7 100644 (file)
@@ -26,11 +26,11 @@ HOOK_CONFIG_SETTINGS="HOOK PRIVACY_EXTENSIONS"
 # Privacy Extensions are disabled by default
 PRIVACY_EXTENSIONS="off"
 
-function hook_check_config_settings() {
+hook_check_config_settings() {
        assert isbool PRIVACY_EXTENSIONS
 }
 
-function hook_create() {
+hook_create() {
        local zone="${1}"
        shift
 
@@ -53,7 +53,7 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_up() {
+hook_up() {
        local zone=${1}
        shift
 
@@ -77,7 +77,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone=${1}
        local config=${2}
        shift 2
@@ -93,7 +93,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone=${1}
        local config=${2}
        shift 2
index 774377528faef06382ea866cc759ca3896fe2ab7..29a5f792bb75e01138a9070878916e5a536df1ec 100644 (file)
@@ -23,7 +23,7 @@
 
 HOOK_CONFIG_SETTINGS="HOOK"
 
-function hook_create() {
+hook_create() {
        local zone="${1}"
        shift
 
@@ -32,7 +32,7 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_up() {
+hook_up() {
        local zone="${1}"
        local config="${2}"
        shift 2
@@ -48,7 +48,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone="${1}"
        local config="${2}"
        shift 2
@@ -64,7 +64,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone="${1}"
        local config="${2}"
        shift 2
index c64ec8b0d6448235dcfc0dd50dd041f100e53df5..f4f9ddf4b6d38ab24ad0bcbd6744b6f86a629782 100644 (file)
@@ -23,7 +23,7 @@
 
 HOOK_SETTINGS="HOOK ADDRESS PREFIX GATEWAY"
 
-function hook_check() {
+hook_check() {
        assert isset ADDRESS
        assert isinteger PREFIX
 
@@ -33,7 +33,7 @@ function hook_check() {
        fi
 }
 
-function hook_create() {
+hook_create() {
        local zone=${1}
        shift
 
@@ -64,7 +64,7 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_up() {
+hook_up() {
        local zone=${1}
        local config=${2}
        shift 2
@@ -86,7 +86,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone=${1}
        local config=${2}
        shift 2
@@ -109,7 +109,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone=${1}
        local config=${2}
        shift 2
index f50ffbeba41562581b23bff29661e62561544a70..84148ddd1e71bcd557c3ba1c0b301b5e3b1e9289 100644 (file)
@@ -37,13 +37,13 @@ SUBNET=
 # 0 = unlimited.
 MAX_SESSIONS=0
 
-function hook_check() {
+hook_check() {
        assert isset MTU
        assert isset SUBNET
        assert isset MAX_SESSIONS
 }
 
-function hook_create() {
+hook_create() {
        local zone=${1}
        shift
 
@@ -70,7 +70,7 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_up() {
+hook_up() {
        local zone=${1}
        local config=${2}
        shift 2
@@ -81,7 +81,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone=${1}
        local config=${2}
        shift 2
@@ -97,7 +97,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone=${1}
        local config=${2}
        shift 2
index 40b9735f69c2922ae4ac164e64cfb143079eac5d..4f1620199b47dfb9e84fbec5780ac3f76ea2aa85 100644 (file)
@@ -28,12 +28,12 @@ PORT_CHILDREN_VAR="SLAVES"
 ADDRESS=$(mac_generate)
 SLAVES=
 
-function hook_check_settings() {
+hook_check_settings() {
        assert isset ADDRESS
        assert ismac ADDRESS
 }
 
-function hook_new() {
+hook_new() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
@@ -57,7 +57,7 @@ function hook_new() {
        exit ${EXIT_OK}
 }
 
-function hook_edit() {
+hook_edit() {
        local port=${1}
        assert isset port
        shift
@@ -94,7 +94,7 @@ function hook_edit() {
        exit ${EXIT_OK}
 }
 
-function hook_create() {
+hook_create() {
        local port="${1}"
        assert isset port
 
@@ -109,7 +109,7 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_remove() {
+hook_remove() {
        local port="${1}"
        assert isset port
 
@@ -121,7 +121,7 @@ function hook_remove() {
        exit ${EXIT_OK}
 }
 
-function hook_hotplug() {
+hook_hotplug() {
        local port="${1}"
        assert isset port
 
@@ -168,7 +168,7 @@ function hook_hotplug() {
        exit ${EXIT_NOT_HANDLED}
 }
 
-function hook_status() {
+hook_status() {
        local port=${1}
        assert isset port
 
index b554c44b4477ff73985954eb4d7801ca02737fc2..6e3f62eeb606dbddb4213eb1a04656c0cd90c8d1 100644 (file)
@@ -28,7 +28,7 @@ SLAVES=""
 MIIMON=100
 MODE="balance-rr"
 
-function hook_check_settings() {
+hook_check_settings() {
        assert isset ADDRESS
        assert ismac ADDRESS
 
@@ -36,11 +36,11 @@ function hook_check_settings() {
        assert isinteger MIIMON
 }
 
-function hook_new() {
+hook_new() {
        hook_edit $@
 }
 
-function hook_edit() {
+hook_edit() {
        local port=${1}
        assert isset port
        shift
@@ -96,7 +96,7 @@ function hook_edit() {
        exit ${EXIT_OK}
 }
 
-function hook_create() {
+hook_create() {
        local port="${1}"
        assert isset port
 
@@ -115,7 +115,7 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_remove() {
+hook_remove() {
        local port="${1}"
        assert isset port
 
@@ -127,7 +127,7 @@ function hook_remove() {
        fi
 }
 
-function hook_up() {
+hook_up() {
        local port="${1}"
        assert isset port
 
@@ -143,7 +143,7 @@ function hook_up() {
        done
 }
 
-function hook_down() {
+hook_down() {
        local port="${1}"
        assert isset port
 
@@ -159,7 +159,7 @@ function hook_down() {
        hook_default_down "${port}"
 }
 
-function hook_hotplug() {
+hook_hotplug() {
        local port="${1}"
        assert isset port
 
index 617084e44b28db03a1fe29ef24ce27a054986d2f..aa313c013a5f8764cb6d848c6658fee78f9d42be 100644 (file)
 
 HOOK_SETTINGS="HOOK ADDRESS"
 
-function hook_check_settings() {
+hook_check_settings() {
        assert ismac ADDRESS
 }
 
-function hook_new() {
+hook_new() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
@@ -55,7 +55,7 @@ function hook_new() {
        exit ${EXIT_OK}
 }
 
-function hook_edit() {
+hook_edit() {
        local port=${1}
        assert isset port
        shift
@@ -79,7 +79,7 @@ function hook_edit() {
        exit ${EXIT_OK} 
 }
 
-function hook_create() {
+hook_create() {
        local port="${1}"
        assert isset port
 
@@ -92,7 +92,7 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_remove() {
+hook_remove() {
        local port="${1}"
        assert isset port
 
@@ -100,7 +100,7 @@ function hook_remove() {
        dummy_remove "${port}"
 }
 
-function hook_up() {
+hook_up() {
        local port="${1}"
        assert isset port
 
@@ -110,7 +110,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local port="${1}"
        assert isset port
 
@@ -120,7 +120,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_hotplug_rename() {
+hook_hotplug_rename() {
        local port=${1}
        assert isset port
 
index 783e0fc7eb70251dd34090b8c63d917f8c8a1335..f33777a7d1c098ac6d4ea9b04e452cebd312f3d3 100644 (file)
@@ -26,7 +26,7 @@
 
 HOOK_SETTINGS="HOOK ADDRESS DEVICE"
 
-function hook_check_settings() {
+hook_check_settings() {
        assert ismac DEVICE
 
        if isset ADDRESS; then
@@ -34,7 +34,7 @@ function hook_check_settings() {
        fi
 }
 
-function hook_new() {
+hook_new() {
        local port=${1}
        assert isset port
        shift
@@ -47,17 +47,17 @@ function hook_new() {
        exit ${EXIT_OK}
 }
 
-function hook_create() {
+hook_create() {
        # Nothing to do here. Real ethernet devices cannot
        # be created. They are just there.
        exit ${EXIT_OK}
 }
 
-function hook_remove() {
+hook_remove() {
        exit ${EXIT_OK}
 }
 
-function hook_hotplug_rename() {
+hook_hotplug_rename() {
        local port=${1}
        assert isset port
 
index b95f6a980fa7f4b081e78d4d033096ba2fda9c3e..344361484fbceb7a6469f6c7630e2b4036efb180 100644 (file)
@@ -25,7 +25,7 @@ HOOK_SETTINGS="HOOK ADDRESS PARENT_DEVICE TAG"
 
 PORT_PARENTS_VAR="PARENT"
 
-function hook_check_settings() {
+hook_check_settings() {
        assert isset PARENT_DEVICE
        assert isinteger TAG
 
@@ -47,7 +47,7 @@ function hook_check_settings() {
        done
 }
 
-function hook_new() {
+hook_new() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --parent-device=*)
@@ -73,7 +73,7 @@ function hook_new() {
        exit ${EXIT_OK}
 }
 
-function hook_edit() {
+hook_edit() {
        local port=${1}
        assert isset port
        shift
@@ -97,7 +97,7 @@ function hook_edit() {
        exit ${EXIT_OK} 
 }
 
-function hook_create() {
+hook_create() {
        local port="${1}"
        assert isset port
 
@@ -112,7 +112,7 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_remove() {
+hook_remove() {
        local port="${1}"
        assert isset port
 
index 7ab639816e2508f4ce7a70cd9c6c2a694876c857..09ab402816b9861baf8217e651a4a28339c9a990 100644 (file)
@@ -30,7 +30,7 @@ MTU=1500
 PHY=
 SSID=
 
-function hook_check_settings() {
+hook_check_settings() {
        assert isset ADDRESS
        assert ismac ADDRESS
        assert isset CHANNEL
@@ -41,7 +41,7 @@ function hook_check_settings() {
        assert isset SSID
 }
 
-function hook_new() {
+hook_new() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
@@ -81,7 +81,7 @@ function hook_new() {
        exit ${EXIT_OK}
 }
 
-function hook_edit() {
+hook_edit() {
        local port=${1}
        assert isset port
        shift
@@ -114,7 +114,7 @@ function hook_edit() {
        exit ${EXIT_OK}
 }
 
-function hook_create() {
+hook_create() {
        local port="${1}"
        assert isset port
 
@@ -138,7 +138,7 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_remove() {
+hook_remove() {
        local port="${1}"
        assert isset port
 
@@ -149,7 +149,7 @@ function hook_remove() {
        exit ${EXIT_OK}
 }
 
-function hook_up() {
+hook_up() {
        local port=${1}
        assert isset port
 
@@ -171,7 +171,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local port="${1}"
        assert isset port
 
@@ -186,7 +186,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_hotplug() {
+hook_hotplug() {
        local port="${1}"
        assert isset port
 
@@ -219,7 +219,7 @@ function hook_hotplug() {
        exit ${EXIT_OK}
 }
 
-function hook_find_parent() {
+hook_find_parent() {
        local port=${1}
        assert isset port
 
index 3ff80d06136050d15cd71de1dc50c61d4f5cb470..dffae405e0875d7c6a1868b79be4f1401491d7d1 100644 (file)
@@ -32,7 +32,7 @@ KEY=""
 MODE="g"
 SSID=
 
-function hook_check_settings() {
+hook_check_settings() {
        assert isset ADDRESS
        assert ismac ADDRESS
        assert isset BROADCAST_SSID
@@ -53,7 +53,7 @@ function hook_check_settings() {
        fi
 }
 
-function hook_new() {
+hook_new() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --broadcast-ssid=*)
@@ -99,7 +99,7 @@ function hook_new() {
        exit ${EXIT_OK}
 }
 
-function hook_edit() {
+hook_edit() {
        local port=${1}
        shift
 
@@ -139,7 +139,7 @@ function hook_edit() {
        exit ${EXIT_OK} 
 }
 
-function hook_create() {
+hook_create() {
        local port="${1}"
        assert isset port
 
@@ -163,7 +163,7 @@ function hook_create() {
        exit ${EXIT_OK}
 }
 
-function hook_remove() {
+hook_remove() {
        local port="${1}"
        assert isset port
 
@@ -175,7 +175,7 @@ function hook_remove() {
        exit ${EXIT_OK}
 }
 
-function hook_up() {
+hook_up() {
        local port="${1}"
        assert isset port
 
@@ -187,14 +187,14 @@ function hook_up() {
        hostapd_start "${port}"
 }
 
-function hook_down() {
+hook_down() {
        local port="${1}"
        assert isset port
 
        hostapd_stop "${port}"
 }
 
-function hook_hotplug() {
+hook_hotplug() {
        local port="${1}"
        assert isset port
 
index a0a9bf951be9de855d9e10da8e7be03545a117ea..6ab94ad953de44a0c1512e6f99006cbb26b5d9f5 100644 (file)
@@ -36,7 +36,7 @@ SERVER_ADDRESS=""
 # The public IPv4 address of the tunnel client.
 PUBLIC_ADDRESS=""
 
-function hook_check_settings() {
+hook_check_settings() {
        assert isset SIX_RD_PREFIX
        assert isset PUBLIC_ADDRESS
        assert isset SERVER_ADDRESS
@@ -70,7 +70,7 @@ function hook_check_settings() {
        fi
 }
 
-function hook_parse_cmdline() {
+hook_parse_cmdline() {
        local value
 
        while [ $# -gt 0 ]; do
@@ -96,7 +96,7 @@ function hook_parse_cmdline() {
        done
 }
 
-function hook_up() {
+hook_up() {
        local zone="${1}"
        assert isset zone
 
@@ -129,7 +129,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone=${1}
        assert isset zone
 
@@ -144,7 +144,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone=${1}
        assert isset zone
 
index 2fc91ad2a6ad5fc14357be0eea4af912bd472f99..fb8c449b70a220f5b554c6096d86d8a6c5f436a4 100644 (file)
@@ -44,7 +44,7 @@ TUNNEL_ID=
 USERNAME=
 PASSWORD=
 
-function hook_check_settings() {
+hook_check_settings() {
        assert isset SERVER_ADDRESS
        assert isset LOCAL_ADDRESS
        assert isset LOCAL_ADDRESS6
@@ -56,7 +56,7 @@ function hook_check_settings() {
        fi
 }
 
-function hook_parse_cmdline() {
+hook_parse_cmdline() {
        local value
 
        while [ $# -gt 0 ]; do
@@ -97,7 +97,7 @@ function hook_parse_cmdline() {
        done
 }
 
-function hook_up() {
+hook_up() {
        local zone=${1}
        assert isset zone
 
@@ -135,7 +135,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone=${1}
        assert isset zone
 
@@ -150,7 +150,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone=${1}
        assert isset zone
 
index d8852ebf247e7b631e20414ab63744bb7fab0860..d6f1e432157ca846a3d054c891981719393bfc5c 100644 (file)
@@ -30,7 +30,7 @@ PROTOCOL="tic"
 TUNNEL_ID=
 REQUIRE_TLS="true"
 
-function hook_check_settings() {
+hook_check_settings() {
        assert isset USERNAME
        assert isset PASSWORD
        assert isset SERVER
@@ -45,7 +45,7 @@ function hook_check_settings() {
        fi
 }
 
-function hook_parse_cmdline() {
+hook_parse_cmdline() {
        local value
 
        while [ $# -gt 0 ]; do
@@ -83,7 +83,7 @@ function hook_parse_cmdline() {
        done
 }
 
-function hook_up() {
+hook_up() {
        local zone=${1}
        assert isset zone
 
@@ -93,7 +93,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone=${1}
        assert isset zone
 
@@ -103,7 +103,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone=${1}
        assert isset zone
 
index c672e73747e0a807af69efe6d86a46d9a51c01bd..7b4e7a4e6e0aeb557c20f51f10a6df192cb1adab 100644 (file)
@@ -38,7 +38,7 @@ STP_HELLO=2
 STP_MAXAGE=20
 STP_PRIORITY=512
 
-function hook_check_settings() {
+hook_check_settings() {
        assert ismac MAC
        assert isbool STP
        assert isoneof STP_MODE stp rstp
@@ -48,7 +48,7 @@ function hook_check_settings() {
        assert isinteger MTU
 }
 
-function hook_parse_cmdline() {
+hook_parse_cmdline() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --stp=*)
@@ -80,7 +80,7 @@ function hook_parse_cmdline() {
        done
 }
 
-function hook_up() {
+hook_up() {
        local zone=${1}
        assert isset zone
 
@@ -132,7 +132,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_hotplug() {
+hook_hotplug() {
        local zone="${1}"
        assert isset zone
 
@@ -162,7 +162,7 @@ function hook_hotplug() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone="${1}"
        assert isset zone
 
@@ -185,7 +185,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone="${1}"
        assert isset zone
 
@@ -240,7 +240,7 @@ function hook_status() {
        exit ${EXIT_OK}
 }
 
-function hook_check_port_settings() {
+hook_check_port_settings() {
        if isset COST; then
                assert isinteger COST
        fi
@@ -250,7 +250,7 @@ function hook_check_port_settings() {
        fi
 }
 
-function hook_port_attach() {
+hook_port_attach() {
        # Excepting at least two arguments here
        assert [ $# -ge 2 ]
 
@@ -282,7 +282,7 @@ function hook_port_attach() {
        exit ${EXIT_OK}
 }
 
-function hook_port_detach() {
+hook_port_detach() {
        assert [ $# -eq 2 ]
 
        local zone="${1}"
@@ -298,11 +298,11 @@ function hook_port_detach() {
        exit ${EXIT_OK}
 }
 
-function hook_port_edit() {
+hook_port_edit() {
        hook_port_attach $@
 }
 
-function hook_port_up() {
+hook_port_up() {
        assert [ $# -eq 2 ]
 
        local zone="${1}"
@@ -337,7 +337,7 @@ function hook_port_up() {
        exit ${EXIT_OK}
 }
 
-function hook_port_down() {
+hook_port_down() {
        assert [ $# -eq 2 ]
 
        local zone="${1}"
@@ -352,7 +352,7 @@ function hook_port_down() {
        exit ${EXIT_OK}
 }
 
-function hook_port_status() {
+hook_port_status() {
        assert [ $# -eq 2 ]
 
        local zone="${1}"
index 441e95e2cc65f452beb5c90c0d859011e192df8c..db5e309d33a95c7d15ac662fa283bca7cb9e7b04 100644 (file)
@@ -70,7 +70,7 @@ HOOK_SETTINGS="${HOOK_SETTINGS} PHONE_NUMBER"
 IMSI=
 HOOK_SETTINGS="${HOOK_SETTINGS} IMSI"
 
-function hook_check_settings() {
+hook_check_settings() {
        assert isset DEVICE
        assert isset PHONE_NUMBER
 
@@ -86,7 +86,7 @@ function hook_check_settings() {
        isset AUTH && assert isoneof AUTH ${MODEM_ALLOWED_AUTH_METHODS}
 }
 
-function hook_parse_cmdline() {
+hook_parse_cmdline() {
        local value
 
        while [ $# -gt 0 ]; do
@@ -135,7 +135,7 @@ function hook_parse_cmdline() {
        done
 }
 
-function hook_up() {
+hook_up() {
        local zone=${1}
        assert isset zone
 
@@ -163,7 +163,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone=${1}
        assert isset zone
 
@@ -173,7 +173,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone=${1}
        assert isset zone
 
@@ -264,7 +264,7 @@ function hook_status() {
        exit ${EXIT_OK}
 }
 
-function hook_ppp_write_config() {
+hook_ppp_write_config() {
        local zone=${1}
        assert isset zone
 
index fa3f4ed6cea12eae693c766ac39721b5221e45b5..b2d0a950a832ef9a3367d495b977f9e0d646a273 100644 (file)
@@ -51,7 +51,7 @@ IPV6="true"
 # Use IPv6 prefix delegation.
 PREFIX_DELEGATION="true"
 
-function hook_check_settings() {
+hook_check_settings() {
        assert isset USERNAME
        assert isset PASSWORD
 
@@ -61,7 +61,7 @@ function hook_check_settings() {
        assert isset PREFIX_DELEGATION
 }
 
-function hook_parse_cmdline() {
+hook_parse_cmdline() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --access-concentrator=*)
@@ -101,7 +101,7 @@ function hook_parse_cmdline() {
        done
 }
 
-function hook_up() {
+hook_up() {
        local zone=${1}
        assert isset zone
 
@@ -125,7 +125,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone=${1}
        assert isset zone
 
@@ -141,7 +141,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_hotplug() {
+hook_hotplug() {
        local zone="${1}"
 
        case "$(hotplug_action)" in
@@ -168,7 +168,7 @@ function hook_hotplug() {
        exit ${EXIT_NOT_HANDLED}
 }
 
-function hook_discover() {
+hook_discover() {
        local device=${1}
 
        # This obviously only works on ethernet (or compatible) devices
@@ -199,7 +199,7 @@ function hook_discover() {
        exit ${DISCOVER_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone=${1}
        assert isset zone
 
@@ -255,7 +255,7 @@ function hook_status() {
        exit ${EXIT_OK}
 }
 
-function hook_ppp_write_config() {
+hook_ppp_write_config() {
        local zone=${1}
        assert isset zone
 
@@ -302,7 +302,7 @@ function hook_ppp_write_config() {
        exit ${EXIT_OK}
 }
 
-function __hook_get_port() {
+__hook_get_port() {
        local zone="${1}"
 
        local port
@@ -314,7 +314,7 @@ function __hook_get_port() {
        return ${EXIT_ERROR}
 }
 
-function hook_port_attach() {
+hook_port_attach() {
        # Excepting at least two arguments here
        assert [ $# -ge 2 ]
 
@@ -338,7 +338,7 @@ function hook_port_attach() {
        exit ${EXIT_OK}
 }
 
-function hook_port_detach() {
+hook_port_detach() {
        assert [ $# -eq 2 ]
 
        local zone="${1}"
@@ -357,7 +357,7 @@ function hook_port_detach() {
        exit ${EXIT_OK}
 }
 
-function hook_ppp_ipv6_up() {
+hook_ppp_ipv6_up() {
        local zone="${1}"
 
        ppp_common_ipv6_up "${zone}"
@@ -372,7 +372,7 @@ function hook_ppp_ipv6_up() {
        exit ${EXIT_OK}
 }
 
-function hook_ppp_ipv6_down() {
+hook_ppp_ipv6_down() {
        local zone="${1}"
 
        ppp_common_ipv6_down "${zone}"
index 52a3da3080cf7c5c52b2867a3f51d81dcc50164e..05c9a797ed7ce10b674e1c653741ef27f16a6044 100644 (file)
@@ -31,7 +31,7 @@ SSID=
 KEY=
 ENCRYPTION_MODE=
 
-function hook_check_settings() {
+hook_check_settings() {
        assert isset SSID
 
        if isset ADDRESS; then
@@ -46,7 +46,7 @@ function hook_check_settings() {
        fi
 }
 
-function hook_parse_cmdline() {
+hook_parse_cmdline() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --phy=*|--parent-device=*)
@@ -76,7 +76,7 @@ function hook_parse_cmdline() {
        PHY=$(phy_get_address ${PHY})
 }
 
-function hook_up() {
+hook_up() {
        local zone=${1}
        assert isset zone
 
@@ -100,7 +100,7 @@ function hook_up() {
        exit ${EXIT_OK}
 }
 
-function hook_down() {
+hook_down() {
        local zone=${1}
        shift
 
@@ -118,7 +118,7 @@ function hook_down() {
        exit ${EXIT_OK}
 }
 
-function hook_status() {
+hook_status() {
        local zone=${1}
        assert isset zone
 
index 867e3a8b433aa957cc7d77b2a829969890366f48..e5a71db9a863c7bee594a1eda7f60600989d97ca 100644 (file)
@@ -38,7 +38,7 @@ done
 # Read network settings
 network_settings_read
 
-function cli_settings() {
+cli_settings() {
        if cli_help_requested $@; then
                cli_show_man network-settings
                exit ${EXIT_OK}
@@ -52,7 +52,7 @@ function cli_settings() {
        fi
 }
 
-function cli_device() {
+cli_device() {
        if cli_help_requested $@; then
                cli_show_man network-device
                exit ${EXIT_OK}
@@ -103,7 +103,7 @@ function cli_device() {
        return ${EXIT_OK}
 }
 
-function cli_device_status() {
+cli_device_status() {
        local device="${1}"
        assert isset device
 
@@ -202,7 +202,7 @@ function cli_device_status() {
        LOG_DISABLE_STDOUT=${log_disable_stdout}
 }
 
-function cli_device_status_serial() {
+cli_device_status_serial() {
        local device=${1}
        assert device_is_serial ${device}
 
@@ -263,7 +263,7 @@ function cli_device_status_serial() {
        cli_space
 }
 
-function cli_device_status_phy() {
+cli_device_status_phy() {
        local phy="${1}"
        assert phy_exists "${phy}"
 
@@ -285,7 +285,7 @@ function cli_device_status_phy() {
        return ${EXIT_OK}
 }
 
-function cli_device_discover() {
+cli_device_discover() {
        local device=${1}
        shift
 
@@ -356,7 +356,7 @@ function cli_device_discover() {
        [ "${up}" = "1" ] || device_set_down ${device}
 }
 
-function cli_device_serial_unlock() {
+cli_device_serial_unlock() {
        if cli_help_requested $@; then
                cli_show_man network-device
                exit ${EXIT_OK}
@@ -442,7 +442,7 @@ function cli_device_serial_unlock() {
        exit $?
 }
 
-function cli_device_send_ussd_command() {
+cli_device_send_ussd_command() {
        local device="${1}"
        assert isset device
        shift
@@ -477,7 +477,7 @@ function cli_device_send_ussd_command() {
        exit $?
 }
 
-function cli_device_monitor() {
+cli_device_monitor() {
        local device="${1}"
        assert isset device
 
@@ -490,7 +490,7 @@ function cli_device_monitor() {
        exit $?
 }
 
-function cli_device_list() {
+cli_device_list() {
        local device
        for device in $(device_list); do
                cli_device_status "${device}"
@@ -499,7 +499,7 @@ function cli_device_list() {
        exit ${EXIT_OK}
 }
 
-function cli_hostname() {
+cli_hostname() {
        if cli_help_requested $@; then
                cli_show_man network
                exit ${EXIT_OK}
@@ -518,7 +518,7 @@ function cli_hostname() {
        exit ${EXIT_OK}
 }
 
-function cli_port() {
+cli_port() {
        if cli_help_requested $@; then
                cli_show_man network-port
                exit ${EXIT_OK}
@@ -557,7 +557,7 @@ function cli_port() {
        fi
 }
 
-function cli_zone() {
+cli_zone() {
        if cli_help_requested $@; then
                cli_show_man network-zone
                exit ${EXIT_OK}
@@ -627,7 +627,7 @@ function cli_zone() {
 # Removes a zone either immediately, if it is currently down,
 # or adds a tag that the removal will be done when the zone
 # is brought down the next time.
-function cli_zone_destroy() {
+cli_zone_destroy() {
        if cli_help_requested $@; then
                cli_show_man network-zone
                exit ${EXIT_OK}
@@ -647,7 +647,7 @@ function cli_zone_destroy() {
        exit ${EXIT_OK}
 }
 
-function cli_zone_port() {
+cli_zone_port() {
        if cli_help_requested $@; then
                cli_show_man network-zone-port
                exit ${EXIT_OK}
@@ -691,7 +691,7 @@ function cli_zone_port() {
        exit ${EXIT_OK}
 }
 
-function cli_list_hooks() {
+cli_list_hooks() {
        local type=${1}
        shift
 
@@ -711,7 +711,7 @@ function cli_list_hooks() {
        done | sort -u
 }
 
-function cli_route() {
+cli_route() {
        if cli_help_requested $@; then
                cli_show_man network-route
                exit ${EXIT_OK}
@@ -748,7 +748,7 @@ function cli_route() {
        exit ${EXIT_OK}
 }
 
-function cli_dhcpd() {
+cli_dhcpd() {
        local proto=${1}
        shift
 
@@ -790,7 +790,7 @@ function cli_dhcpd() {
        exit ${EXIT_OK}
 }
 
-function cli_dhcpd_show() {
+cli_dhcpd_show() {
        local proto=${1}
        assert isset proto
 
@@ -860,7 +860,7 @@ function cli_dhcpd_show() {
        fi
 }
 
-function cli_dhcpd_subnet() {
+cli_dhcpd_subnet() {
        local proto=${1}
        shift
 
@@ -937,7 +937,7 @@ function cli_dhcpd_subnet() {
        exit ${EXIT_OK}
 }
 
-function cli_dhcpd_subnet_range() {
+cli_dhcpd_subnet_range() {
        local proto=${1}
        assert isset proto
        shift
@@ -966,7 +966,7 @@ function cli_dhcpd_subnet_range() {
        esac
 }
 
-function cli_dhcpd_subnet_show() {
+cli_dhcpd_subnet_show() {
        local proto=${1}
        assert isset proto
 
@@ -1024,7 +1024,7 @@ function cli_dhcpd_subnet_show() {
        cli_space
 }
 
-function cli_dhcpd_subnet_options() {
+cli_dhcpd_subnet_options() {
        local proto=${1}
        assert isset proto
        shift
@@ -1045,7 +1045,7 @@ function cli_dhcpd_subnet_options() {
        done
 }
 
-function cli_start() {
+cli_start() {
        if cli_help_requested $@; then
                cli_show_man network
                exit ${EXIT_OK}
@@ -1061,7 +1061,7 @@ function cli_start() {
        wait # until everything is settled
 }
 
-function cli_stop() {
+cli_stop() {
        if cli_help_requested $@; then
                cli_show_man network
                exit ${EXIT_OK}
@@ -1077,7 +1077,7 @@ function cli_stop() {
        wait # until everything is settled
 }
 
-function cli_restart() {
+cli_restart() {
        if cli_help_requested $@; then
                cli_show_man network
                exit ${EXIT_OK}
@@ -1091,7 +1091,7 @@ function cli_restart() {
        cli_start $@
 }
 
-function cli_status() {
+cli_status() {
        if cli_help_requested $@; then
                cli_show_man network
                exit ${EXIT_OK}
@@ -1114,7 +1114,7 @@ function cli_status() {
        LOG_DISABLE_STDOUT=${log_disable_stdout}
 }
 
-function cli_reset() {
+cli_reset() {
        if cli_help_requested $@; then
                cli_show_man network
                exit ${EXIT_OK}
@@ -1164,7 +1164,7 @@ function cli_reset() {
 # Help function: will show the default man page to the user.
 # Optionally, there are two arguments taken, the type of hook
 # and which hook should be shown.
-function cli_help() {
+cli_help() {
        local type=${1}
        local what=${2}
 
@@ -1187,7 +1187,7 @@ function cli_help() {
        hook_exec ${type} ${what} help
 }
 
-function cli_dns_server() {
+cli_dns_server() {
        if cli_help_requested $@; then
                cli_show_man network-dns-server
                exit ${EXIT_OK}
@@ -1242,7 +1242,7 @@ function cli_dns_server() {
        exit ${EXIT_OK}
 }
 
-function cli_raw() {
+cli_raw() {
        local cmd="${1}"
        assert isset cmd
        shift
index 640ad74bccb73ce9a86743418c6243885ccf281c..5d8be0c3bf4785350ae9237c100365725081fdd8 100644 (file)
@@ -62,7 +62,7 @@ commandline="${commandline} -f ${file}"
 
 # Helper function to write beatiful lines to
 # the chat scripts.
-function println() {
+println() {
        printf "%-30s %s\n" "$@" >> ${file}
 }
 
index a206e67d0f13563e058708d84b2012c5b184f944..c56c70d1a4ff06ff48811173cb9d12d77da7f7a5 100644 (file)
@@ -30,7 +30,7 @@ network_settings_read
 
 # Setup the locking.
 LOCKFILE="${RUN_DIR}/.rename_lock"
-function cleanup() {
+cleanup() {
        lock_release ${LOCKFILE}
 }
 trap cleanup EXIT TERM KILL