From: Tomek Mrugalski Date: Mon, 4 Mar 2019 14:34:57 +0000 (+0100) Subject: local variables declared and initialized separately X-Git-Tag: 465-add-subnet4-update-and-subnet6-update-commands-to-subnet-cmds-hook_base2~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cf0cab178af7b3d050908c548d38f6f5268eef0;p=thirdparty%2Fkea.git local variables declared and initialized separately --- diff --git a/src/bin/keactrl/keactrl.in b/src/bin/keactrl/keactrl.in index 50f2d092de..5ca2664668 100644 --- a/src/bin/keactrl/keactrl.in +++ b/src/bin/keactrl/keactrl.in @@ -158,7 +158,8 @@ start_server() { binary_path=${1} # Full path to the binary. full_command=$@ # Binary and arguments. # Extract the name of the binary from the path. - local binary_name=$(basename "${binary_path}") + local binary_name + binary_name=$(basename "${binary_path}") # Use the binary name to check if the process is already running. check_running "${binary_name}" # If process is running, don't start another one. Just log a message. @@ -177,7 +178,8 @@ stop_server() { binary_path=${1} # Full path to the binary. local sig=15 # Extract the name of the binary from the path. - local binary_name=$(basename "${binary_path}") + local binary_name + binary_name=$(basename "${binary_path}") # Use the binary name to check if the process is already running. check_running "${binary_name}" @@ -199,7 +201,8 @@ reload_server() { binary_path=${1} # Full path to the binary. local sig=1 # Extract the name of the binary from the path. - local binary_name=$(basename "${binary_path}") + local binary_name + binary_name=$(basename "${binary_path}") # Use the binary name to check if the process is already running. check_running "${binary_name}" @@ -292,10 +295,12 @@ run_conditional() { # Get the configuration value of the keactrl which indicates whether # the server should be enabled or not. Variables that hold these values # are: ${dhcp4}, ${dhcp6}, ${dhcp_ddns}. - local file_config=$( eval printf "%s" "\${$server}" ) + local file_config + file_config=$( eval printf "%s" "\${$server}" ) # Get the location of the current Kea configuration file. This will be used # to check that the file exists before it is used. - local kea_config_location=$( eval printf "%s" "\$kea_${server}_config_file" ) + local kea_config_location + kea_config_location=$( eval printf "%s" "\$kea_${server}_config_file" ) # Run the commands if we ignore the configuration setting or if the # setting is "yes". if [ "${check_file_cfg}" -eq 0 ] || [ "${file_config}" = "yes" ]; then