From: Michael Tremer Date: Sat, 10 Jul 2010 08:34:04 +0000 (+0200) Subject: network: Remove some unneeded functions. X-Git-Tag: 001~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=852091a322325d16c86a8d3751fc5325ae88c69b;p=network.git network: Remove some unneeded functions. --- diff --git a/functions.device b/functions.device index 54e4d6e6..cc1bba80 100644 --- a/functions.device +++ b/functions.device @@ -776,105 +776,6 @@ function device_has_ipv6() { ip addr show ${device} | grep -q "inet6 ${addr}" } -function device_config_list() { - local device - for device in ${CONFIG_DIR}/devices/*; do - device=$(basename ${device}) - if device_config_exists ${device}; then - echo "${device}" - fi - done -} - -function device_config_exists() { - local device=${1} - - [ -e "${CONFIG_DIR}/devices/${device}" ] -} - -function device_config_write() { - local device=${1} - shift - - config_write ${CONFIG_DIR}/devices/${device} $@ -} - -function device_config_read() { - local device=${1} - - config_read ${CONFIG_DIR}/devices/${device} -} - -function device_create() { - local hook=${1} - shift - - if ! hook_exists device ${hook}; then - error "Hook '${hook}' does not exist." - return ${EXIT_ERROR} - fi - - hook_exec device ${hook} create $@ -} - -# XXX to be fixed -function device_up() { - local device=${1} - shift - - if ! device_config_exists ${device}; then - error "Device '${device}' does not exist." - return ${EXIT_ERROR} - fi - - local hook=$(config_get_hook ${CONFIG_DIR}/devices/${device}) - - if ! hook_exists device ${hook}; then - error "Hook '${hook}' does not exist." - return ${EXIT_ERROR} - fi - - hook_exec device ${hook} up ${device} $@ -} - -# XXX to be fixed -function device_down() { - local device=${1} - shift - - if ! device_config_exists ${device}; then - error "Device '${device}' does not exist." - return ${EXIT_ERROR} - fi - - local hook=$(config_get_hook ${CONFIG_DIR}/devices/${device}) - - if ! hook_exists device ${hook}; then - error "Hook '${hook}' does not exist." - return ${EXIT_ERROR} - fi - - hook_exec device ${hook} down ${device} $@ -} - -function device_print() { - local device=${1} - local type=$(device_get_type ${device}) - - echo "${device}" - printf "${DEVICE_PRINT_LINE1}" "Type:" "${type}" - - #device_config_exists ${device} - #local has_config=$? - - # XXX need something is_function() method here - if [ -n "$(type -t ${type}_device_print)" ]; then - ${type}_device_print ${device} - fi - - echo # Empty line -} - function __device_get_file() { local device=${1} local file=${2}