The variable interface is used in the sub-function 'modemmanager_check_state'.
However, this is not an argument of the function and so the global value
is used. Addding the variable as an function call argument fixes this.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
modemmanager_check_state() {
local device="$1"
- local modemstatus="$2"
- local pincode="$3"
+ local interface="$2"
+ local modemstatus="$3"
+ local pincode="$4"
local state
}
echo "modem available at ${modempath}"
- modemmanager_check_state "$device" "${modemstatus}" "$pincode"
+ modemmanager_check_state "$device" "$interface" "${modemstatus}" "$pincode"
[ "$?" -ne "0" ] && return 1
# always cleanup before attempting a new connection, just in case