|
|
|
@ -72,7 +72,7 @@ function config_set_value()
|
|
|
|
|
# parameters: SettingName SettingValue
|
|
|
|
|
{
|
|
|
|
|
mount -o rw,remount "$CONFIG_DIR"
|
|
|
|
|
echo "$2" > "$CONFIG_DIR/$1"
|
|
|
|
|
echo -n "$2" > "$CONFIG_DIR/$1"
|
|
|
|
|
mount -o ro,remount "$CONFIG_DIR"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -88,7 +88,8 @@ function config_get_value()
|
|
|
|
|
fi
|
|
|
|
|
[ -z "$1" ] && error_msg 1 "empty setting name"
|
|
|
|
|
[ ! -e "$conf_dir/$1" ] && error_msg 2 "unknown configuration value ($1)"
|
|
|
|
|
cat "$conf_dir/$1"
|
|
|
|
|
# remove trailing line break
|
|
|
|
|
echo -n $(cat "$conf_dir/$1")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -126,7 +127,8 @@ function create_config()
|
|
|
|
|
function get_current_ip()
|
|
|
|
|
# not necessarily the same as configured (necessary for validation)
|
|
|
|
|
{
|
|
|
|
|
ifconfig $NET_IFACE | grep "inet" | cut -d ":" -f2 | cut -d " " -f1
|
|
|
|
|
# filter the output of ifconfig and remove trailing line break
|
|
|
|
|
echo -n $(ifconfig $NET_IFACE | grep "inet" | cut -d ":" -f2 | cut -d " " -f1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|