Choosing a variant
This commit is contained in:
parent
5025c5c227
commit
c9f8427ecb
|
@ -773,11 +773,10 @@ function choose_full_name {
|
||||||
|
|
||||||
function choose_system_variant {
|
function choose_system_variant {
|
||||||
available_variants_list=()
|
available_variants_list=()
|
||||||
variants_list=$(available_system_variants)
|
available_system_variants
|
||||||
|
|
||||||
varslist=""
|
varslist=""
|
||||||
n=1
|
n=1
|
||||||
vars_index=0
|
|
||||||
for a in "${available_variants_list[@]}"
|
for a in "${available_variants_list[@]}"
|
||||||
do
|
do
|
||||||
varstate='off'
|
varstate='off'
|
||||||
|
@ -786,17 +785,18 @@ function choose_system_variant {
|
||||||
fi
|
fi
|
||||||
varslist="$varslist $n $a $varstate"
|
varslist="$varslist $n $a $varstate"
|
||||||
n=$[n+1]
|
n=$[n+1]
|
||||||
vars_index=$[vars_index+1]
|
|
||||||
done
|
done
|
||||||
|
|
||||||
variant_choice=$(dialog --stdout --backtitle $"Freedombone Configuration" \
|
variant_choice=$(dialog --stdout --backtitle $"Freedombone Configuration" \
|
||||||
--title $"Type of Installation" \
|
--title $"Type of Installation" \
|
||||||
--radiolist $'Choose:' \
|
--radiolist $'Choose:' \
|
||||||
27 40 20 $varslist)
|
27 40 20 $varslist)
|
||||||
variant_choice=$((variant_choice - 1))
|
|
||||||
export SYSTEM_TYPE=${variants_list[$variant_choice]}
|
if [ $? -eq 0 ]; then
|
||||||
save_configuration_values
|
variant_choice=$[variant_choice-1]
|
||||||
write_config_param "SYSTEM_TYPE" "$SYSTEM_TYPE"
|
SYSTEM_TYPE=${available_variants_list[$variant_choice]}
|
||||||
|
save_configuration_values
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate_freedns_code {
|
function validate_freedns_code {
|
||||||
|
|
|
@ -99,19 +99,20 @@ function item_in_array {
|
||||||
function available_system_variants {
|
function available_system_variants {
|
||||||
FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
|
FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
|
||||||
|
|
||||||
available_variants_list=()
|
new_available_variants_list=()
|
||||||
for filename in $FILES
|
for filename in $FILES
|
||||||
do
|
do
|
||||||
system_variants_list=$(app_variants $filename)
|
system_variants_list=$(app_variants $filename)
|
||||||
variants_array=($system_variants_list)
|
variants_array=($system_variants_list)
|
||||||
for variant_str in "${variants_array[@]}"
|
for variant_str in "${variants_array[@]}"
|
||||||
do
|
do
|
||||||
item_in_array "${variant_str}" "${available_variants_list[@]}"
|
item_in_array "${variant_str}" "${new_available_variants_list[@]}"
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
available_variants_list+=("$variant_str")
|
new_available_variants_list+=("$variant_str")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
available_variants_list=($(sort <<<"${new_available_variants_list[*]}"))
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_valid_variant {
|
function is_valid_variant {
|
||||||
|
|
Loading…
Reference in New Issue