Arrays without quotes
This commit is contained in:
parent
545a5381cd
commit
bf25e6ac37
|
@ -72,7 +72,8 @@ function mark_unselected_apps_as_removed {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
app_index=0
|
app_index=0
|
||||||
for app_name in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for app_name in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
|
if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
|
||||||
echo "_${app_name}_" >> "$REMOVED_APPS_FILE"
|
echo "_${app_name}_" >> "$REMOVED_APPS_FILE"
|
||||||
|
@ -106,7 +107,8 @@ function show_apps {
|
||||||
applist=""
|
applist=""
|
||||||
n=1
|
n=1
|
||||||
app_index=0
|
app_index=0
|
||||||
for a in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
if [[ ${APPS_INSTALLED[$app_index]} == "0" && "$select_all_apps" != "add-all" ]]; then
|
if [[ ${APPS_INSTALLED[$app_index]} == "0" && "$select_all_apps" != "add-all" ]]; then
|
||||||
applist="$applist $n $a off"
|
applist="$applist $n $a off"
|
||||||
|
@ -144,7 +146,8 @@ function remove_apps_selected {
|
||||||
removals=""
|
removals=""
|
||||||
app_index=0
|
app_index=0
|
||||||
n=0
|
n=0
|
||||||
for a in "${APPS_INSTALLED[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_INSTALLED[@]}
|
||||||
do
|
do
|
||||||
if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then
|
if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then
|
||||||
if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
|
if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
|
||||||
|
@ -188,7 +191,8 @@ function install_apps_selected {
|
||||||
installs=""
|
installs=""
|
||||||
app_index=0
|
app_index=0
|
||||||
n=0
|
n=0
|
||||||
for a in "${APPS_INSTALLED[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_INSTALLED[@]}
|
||||||
do
|
do
|
||||||
if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
|
if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
|
||||||
if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
|
if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
|
||||||
|
|
|
@ -211,7 +211,8 @@ chmod 600 "/home/$ADD_USERNAME/README"
|
||||||
echo $'Detecting installed apps...'
|
echo $'Detecting installed apps...'
|
||||||
detect_apps
|
detect_apps
|
||||||
get_apps_installed_names
|
get_apps_installed_names
|
||||||
for app_name in "${APPS_INSTALLED_NAMES[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for app_name in ${APPS_INSTALLED_NAMES[@]}
|
||||||
do
|
do
|
||||||
if [[ $(function_exists "add_user_${app_name}") == "1" ]]; then
|
if [[ $(function_exists "add_user_${app_name}") == "1" ]]; then
|
||||||
echo $"Adding user to ${app_name}"
|
echo $"Adding user to ${app_name}"
|
||||||
|
|
|
@ -295,7 +295,8 @@ function pelican_change_theme {
|
||||||
if [ -f $PELICAN_BLOG_INSTALL_DIR/.blog-theme-index ]; then
|
if [ -f $PELICAN_BLOG_INSTALL_DIR/.blog-theme-index ]; then
|
||||||
curr_theme_index=$(cat $PELICAN_BLOG_INSTALL_DIR/.blog-theme-index)
|
curr_theme_index=$(cat $PELICAN_BLOG_INSTALL_DIR/.blog-theme-index)
|
||||||
fi
|
fi
|
||||||
for a in "${THEMES[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${THEMES[@]}
|
||||||
do
|
do
|
||||||
is_selected='off'
|
is_selected='off'
|
||||||
if [ "$curr_theme_index" ]; then
|
if [ "$curr_theme_index" ]; then
|
||||||
|
|
|
@ -180,7 +180,7 @@ function expire_pleroma_posts {
|
||||||
echo '';
|
echo '';
|
||||||
echo '# copy the avatar files to a temporary directory';
|
echo '# copy the avatar files to a temporary directory';
|
||||||
echo "arr=( \$avatars )";
|
echo "arr=( \$avatars )";
|
||||||
echo "for i in \"\${arr[@]}\"; do";
|
echo "for i in \${arr[@]}; do";
|
||||||
echo " if [[ \"\$i\" == *'/media/'* ]]; then";
|
echo " if [[ \"\$i\" == *'/media/'* ]]; then";
|
||||||
echo " imagefile=/etc/pleroma/uploads/\$(echo \$i | sed 's|\"||g' | sed 's|,||g' | awk -F '/media/' '{print \$2}');";
|
echo " imagefile=/etc/pleroma/uploads/\$(echo \$i | sed 's|\"||g' | sed 's|,||g' | awk -F '/media/' '{print \$2}');";
|
||||||
echo " if [ -f \$imagefile ]; then";
|
echo " if [ -f \$imagefile ]; then";
|
||||||
|
@ -203,7 +203,7 @@ function expire_pleroma_posts {
|
||||||
echo '';
|
echo '';
|
||||||
echo '# copy the banner files to a temporary directory';
|
echo '# copy the banner files to a temporary directory';
|
||||||
echo "arr=( \$banners )";
|
echo "arr=( \$banners )";
|
||||||
echo "for i in \"\${arr[@]}\"; do";
|
echo "for i in \${arr[@]}; do";
|
||||||
echo " if [[ \"\$i\" == *'/media/'* ]]; then";
|
echo " if [[ \"\$i\" == *'/media/'* ]]; then";
|
||||||
echo " imagefile=/etc/pleroma/uploads/\$(echo \$i | sed 's|\"||g' | sed 's|,||g' | awk -F '/media/' '{print \$2}');";
|
echo " imagefile=/etc/pleroma/uploads/\$(echo \$i | sed 's|\"||g' | sed 's|,||g' | awk -F '/media/' '{print \$2}');";
|
||||||
echo " if [ -f \$imagefile ]; then";
|
echo " if [ -f \$imagefile ]; then";
|
||||||
|
|
|
@ -228,7 +228,8 @@ function backup_directories {
|
||||||
"/root/.passwords, passwordstore"
|
"/root/.passwords, passwordstore"
|
||||||
)
|
)
|
||||||
|
|
||||||
for dr in "${backup_dirs[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for dr in ${backup_dirs[@]}
|
||||||
do
|
do
|
||||||
# if this directory exists then back it up to the given destination
|
# if this directory exists then back it up to the given destination
|
||||||
source_directory=$(echo "$dr" | awk -F ',' '{print $1}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
source_directory=$(echo "$dr" | awk -F ',' '{print $1}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
|
|
|
@ -798,7 +798,8 @@ function choose_system_variant {
|
||||||
|
|
||||||
varslist=""
|
varslist=""
|
||||||
n=1
|
n=1
|
||||||
for a in "${available_variants_list[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${available_variants_list[@]}
|
||||||
do
|
do
|
||||||
varstate='off'
|
varstate='off'
|
||||||
if [[ "$a" == $'full' || "$a" == $'Full' ]]; then
|
if [[ "$a" == $'full' || "$a" == $'Full' ]]; then
|
||||||
|
@ -1057,7 +1058,8 @@ function select_user {
|
||||||
users_array=($homedirs)
|
users_array=($homedirs)
|
||||||
|
|
||||||
delete=(git)
|
delete=(git)
|
||||||
for del in "${delete[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for del in ${delete[@]}
|
||||||
do
|
do
|
||||||
# shellcheck disable=SC2206
|
# shellcheck disable=SC2206
|
||||||
users_array=(${users_array[@]/$del})
|
users_array=(${users_array[@]/$del})
|
||||||
|
|
|
@ -230,7 +230,8 @@ function passwords_show_apps {
|
||||||
i=0
|
i=0
|
||||||
W=()
|
W=()
|
||||||
name=()
|
name=()
|
||||||
for a in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
if [[ $(function_exists "change_password_${a}") == "1" ]]; then
|
if [[ $(function_exists "change_password_${a}") == "1" ]]; then
|
||||||
i=$((i+1))
|
i=$((i+1))
|
||||||
|
@ -410,7 +411,8 @@ function show_domains {
|
||||||
grep 'sks onion domain' "${COMPLETION_FILE}" | awk -F ':' '{print $2}'
|
grep 'sks onion domain' "${COMPLETION_FILE}" | awk -F ':' '{print $2}'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for app_name in "${APPS_INSTALLED_NAMES[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for app_name in ${APPS_INSTALLED_NAMES[@]}
|
||||||
do
|
do
|
||||||
if ! grep -q "SHOW_ON_ABOUT=1" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"; then
|
if ! grep -q "SHOW_ON_ABOUT=1" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"; then
|
||||||
continue
|
continue
|
||||||
|
@ -1129,7 +1131,8 @@ function restore_data_from_storage {
|
||||||
app_list+=("$AllStr")
|
app_list+=("$AllStr")
|
||||||
|
|
||||||
util_index=0
|
util_index=0
|
||||||
for a in "${utils_installed[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${utils_installed[@]}
|
||||||
do
|
do
|
||||||
applist="$applist $n $a off"
|
applist="$applist $n $a off"
|
||||||
app_name=${utils_installed[util_index]}
|
app_name=${utils_installed[util_index]}
|
||||||
|
@ -1139,7 +1142,8 @@ function restore_data_from_storage {
|
||||||
done
|
done
|
||||||
|
|
||||||
app_index=0
|
app_index=0
|
||||||
for a in "${APPS_INSTALLED_NAMES[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_INSTALLED_NAMES[@]}
|
||||||
do
|
do
|
||||||
applist="$applist $n $a off"
|
applist="$applist $n $a off"
|
||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
|
@ -2233,7 +2237,8 @@ function menu_app_settings {
|
||||||
appnames=()
|
appnames=()
|
||||||
n=1
|
n=1
|
||||||
app_index=0
|
app_index=0
|
||||||
for a in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
if [[ ${APPS_INSTALLED[$app_index]} != "0" ]]; then
|
if [[ ${APPS_INSTALLED[$app_index]} != "0" ]]; then
|
||||||
if [[ $(function_exists "configure_interactive_${a}") == "1" ]]; then
|
if [[ $(function_exists "configure_interactive_${a}") == "1" ]]; then
|
||||||
|
|
|
@ -837,7 +837,8 @@ function menu_run_client_app {
|
||||||
appnames=()
|
appnames=()
|
||||||
n=1
|
n=1
|
||||||
app_index=0
|
app_index=0
|
||||||
for a in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
if [[ ${APPS_INSTALLED[$app_index]} != "0" ]]; then
|
if [[ ${APPS_INSTALLED[$app_index]} != "0" ]]; then
|
||||||
if [[ $(function_exists "run_client_${a}") == "1" ]]; then
|
if [[ $(function_exists "run_client_${a}") == "1" ]]; then
|
||||||
|
|
|
@ -55,7 +55,8 @@ detected_codes=()
|
||||||
codelines=$(grep "_CODE=" "$CONFIGURATION_FILE" | uniq)
|
codelines=$(grep "_CODE=" "$CONFIGURATION_FILE" | uniq)
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
code=$(echo "$line" | awk -F '=' '{print $2}')
|
code=$(echo "$line" | awk -F '=' '{print $2}')
|
||||||
if ! item_in_array "$code" "${detected_codes[@]}"; then
|
# shellcheck disable=SC2068
|
||||||
|
if ! item_in_array "$code" ${detected_codes[@]}; then
|
||||||
detected_codes+=("$code")
|
detected_codes+=("$code")
|
||||||
fi
|
fi
|
||||||
done <<< "$codelines"
|
done <<< "$codelines"
|
||||||
|
@ -64,7 +65,8 @@ if [ ! -d "$HOME/.freedns-update" ]; then
|
||||||
mkdir "$HOME/.freedns-update"
|
mkdir "$HOME/.freedns-update"
|
||||||
fi
|
fi
|
||||||
cd "$HOME/.freedns-update" || exit 2467824684
|
cd "$HOME/.freedns-update" || exit 2467824684
|
||||||
for code in "${detected_codes[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for code in ${detected_codes[@]}
|
||||||
do
|
do
|
||||||
if [ $VERBOSE ]; then
|
if [ $VERBOSE ]; then
|
||||||
echo $"command: $FREEDNS_WGET${code}="
|
echo $"command: $FREEDNS_WGET${code}="
|
||||||
|
|
|
@ -482,7 +482,8 @@ fi
|
||||||
|
|
||||||
# Move any existing images into a build subdirectory
|
# Move any existing images into a build subdirectory
|
||||||
image_types=( xz img sig vdi qcow2 )
|
image_types=( xz img sig vdi qcow2 )
|
||||||
for im in "${image_types[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for im in ${image_types[@]}
|
||||||
do
|
do
|
||||||
# shellcheck disable=SC2012,SC2086
|
# shellcheck disable=SC2012,SC2086
|
||||||
no_of_files=$(ls -afq ${CURR_DIR}/${PROJECT_NAME}*.${im} | wc -l)
|
no_of_files=$(ls -afq ${CURR_DIR}/${PROJECT_NAME}*.${im} | wc -l)
|
||||||
|
@ -496,7 +497,8 @@ do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Delete anything which didn't move
|
# Delete anything which didn't move
|
||||||
for im in "${image_types[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for im in ${image_types[@]}
|
||||||
do
|
do
|
||||||
# shellcheck disable=SC2012,SC2086
|
# shellcheck disable=SC2012,SC2086
|
||||||
no_of_files=$(ls -afq ${CURR_DIR}/${PROJECT_NAME}*.${im} | wc -l)
|
no_of_files=$(ls -afq ${CURR_DIR}/${PROJECT_NAME}*.${im} | wc -l)
|
||||||
|
@ -624,7 +626,8 @@ if [ ${#imgfiles[@]} -eq 0 ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Move images from temporary directory to the current directory
|
# Move images from temporary directory to the current directory
|
||||||
for im in "${image_types[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for im in ${image_types[@]}
|
||||||
do
|
do
|
||||||
# shellcheck disable=SC2012,SC2086
|
# shellcheck disable=SC2012,SC2086
|
||||||
no_of_files=$(ls -afq build/${PROJECT_NAME}*.${im} | wc -l)
|
no_of_files=$(ls -afq build/${PROJECT_NAME}*.${im} | wc -l)
|
||||||
|
|
|
@ -73,7 +73,8 @@ function logging_get_app_names {
|
||||||
function turn_logging_on {
|
function turn_logging_on {
|
||||||
logging_get_app_names
|
logging_get_app_names
|
||||||
|
|
||||||
for a in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
echo $"Turning on logging for ${a}"
|
echo $"Turning on logging for ${a}"
|
||||||
"logging_on_${a}"
|
"logging_on_${a}"
|
||||||
|
@ -83,7 +84,8 @@ function turn_logging_on {
|
||||||
function turn_logging_off {
|
function turn_logging_off {
|
||||||
logging_get_app_names
|
logging_get_app_names
|
||||||
|
|
||||||
for a in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
echo $"Turning off logging for ${a}"
|
echo $"Turning off logging for ${a}"
|
||||||
"logging_off_${a}"
|
"logging_off_${a}"
|
||||||
|
|
|
@ -187,7 +187,8 @@ function change_theme {
|
||||||
if [ -f /tmp/.blog-themes ]; then
|
if [ -f /tmp/.blog-themes ]; then
|
||||||
rm /tmp/.blog-themes
|
rm /tmp/.blog-themes
|
||||||
fi
|
fi
|
||||||
for a in "${THEMES[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${THEMES[@]}
|
||||||
do
|
do
|
||||||
echo "$n $a" >> /tmp/.blog-themes
|
echo "$n $a" >> /tmp/.blog-themes
|
||||||
n=$((n+1))
|
n=$((n+1))
|
||||||
|
|
|
@ -124,7 +124,8 @@ fi
|
||||||
echo $'Detecting installed apps...'
|
echo $'Detecting installed apps...'
|
||||||
detect_apps
|
detect_apps
|
||||||
get_apps_installed_names
|
get_apps_installed_names
|
||||||
for app_name in "${APPS_INSTALLED_NAMES[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for app_name in ${APPS_INSTALLED_NAMES[@]}
|
||||||
do
|
do
|
||||||
if [[ $(function_exists "remove_user_${app_name}") == "1" ]]; then
|
if [[ $(function_exists "remove_user_${app_name}") == "1" ]]; then
|
||||||
echo $"Removing user from ${app_name}"
|
echo $"Removing user from ${app_name}"
|
||||||
|
|
|
@ -124,7 +124,8 @@ function test_app_functions {
|
||||||
for filename in $FILES
|
for filename in $FILES
|
||||||
do
|
do
|
||||||
# for each expected interface function
|
# for each expected interface function
|
||||||
for f in "${interface_functions[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for f in ${interface_functions[@]}
|
||||||
do
|
do
|
||||||
test_app_function_type "${filename}" "$f"
|
test_app_function_type "${filename}" "$f"
|
||||||
done
|
done
|
||||||
|
|
|
@ -543,7 +543,8 @@ function backup_apps {
|
||||||
detect_installable_apps
|
detect_installable_apps
|
||||||
get_apps_installed_names
|
get_apps_installed_names
|
||||||
|
|
||||||
for app_name in "${APPS_INSTALLED_NAMES[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for app_name in ${APPS_INSTALLED_NAMES[@]}
|
||||||
do
|
do
|
||||||
echo $"Backup ${app_name}"
|
echo $"Backup ${app_name}"
|
||||||
app_load_variables "${app_name}"
|
app_load_variables "${app_name}"
|
||||||
|
@ -563,7 +564,8 @@ function restore_apps {
|
||||||
detect_installable_apps
|
detect_installable_apps
|
||||||
get_apps_installed_names
|
get_apps_installed_names
|
||||||
|
|
||||||
for app_name in "${APPS_INSTALLED_NAMES[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for app_name in ${APPS_INSTALLED_NAMES[@]}
|
||||||
do
|
do
|
||||||
confirm_restore=
|
confirm_restore=
|
||||||
if [ ! "$2" ]; then
|
if [ ! "$2" ]; then
|
||||||
|
@ -807,7 +809,8 @@ function valid_backup_destination {
|
||||||
available_variants_list=()
|
available_variants_list=()
|
||||||
available_system_variants
|
available_system_variants
|
||||||
|
|
||||||
if ! item_in_array "${destination_dir}" "${available_variants_list[@]}"; then
|
# shellcheck disable=SC2068
|
||||||
|
if ! item_in_array "${destination_dir}" ${available_variants_list[@]}; then
|
||||||
is_valid="no"
|
is_valid="no"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,8 @@ function remove_completion_param {
|
||||||
}
|
}
|
||||||
|
|
||||||
function save_configuration_values {
|
function save_configuration_values {
|
||||||
for v in "${configuration_variables[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for v in ${configuration_variables[@]}
|
||||||
do
|
do
|
||||||
write_config_param "$v" "${!v}"
|
write_config_param "$v" "${!v}"
|
||||||
done
|
done
|
||||||
|
@ -299,7 +300,8 @@ function read_configuration_values {
|
||||||
cp "$CONFIGURATION_FILE" "/root/${PROJECT_NAME}.cfg"
|
cp "$CONFIGURATION_FILE" "/root/${PROJECT_NAME}.cfg"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for v in "${configuration_variables[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for v in ${configuration_variables[@]}
|
||||||
do
|
do
|
||||||
read_config_param "$v"
|
read_config_param "$v"
|
||||||
done
|
done
|
||||||
|
@ -337,13 +339,14 @@ function check_domains {
|
||||||
domains_array=("$specified_domains")
|
domains_array=("$specified_domains")
|
||||||
checked_domains=()
|
checked_domains=()
|
||||||
|
|
||||||
for d in "${domains_array[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for d in ${domains_array[@]}
|
||||||
do
|
do
|
||||||
domain_param=$(echo "$d" | awk -F '=' '{print $1}')
|
domain_param=$(echo "$d" | awk -F '=' '{print $1}')
|
||||||
if [[ "$domain_param" != "DEFAULT_DOMAIN_NAME" ]]; then
|
if [[ "$domain_param" != "DEFAULT_DOMAIN_NAME" ]]; then
|
||||||
domain_value=$(echo "$d" | awk -F '=' '{print $2}')
|
domain_value=$(echo "$d" | awk -F '=' '{print $2}')
|
||||||
if [[ "$domain_value" != "${LOCAL_NAME}.local" ]]; then
|
if [[ "$domain_value" != "${LOCAL_NAME}.local" ]]; then
|
||||||
if ! item_in_array "${domain_value}" "${checked_domains[@]}"; then
|
if ! item_in_array "${domain_value}" ${checked_domains[@]}; then
|
||||||
# test that this is a valid domain name
|
# test that this is a valid domain name
|
||||||
function_check test_domain_name
|
function_check test_domain_name
|
||||||
test_domain_name "$domain_value"
|
test_domain_name "$domain_value"
|
||||||
|
|
|
@ -69,7 +69,8 @@ function app_load_variables {
|
||||||
|
|
||||||
#shellcheck disable=SC2206
|
#shellcheck disable=SC2206
|
||||||
configvarname=( ${!configvarname} )
|
configvarname=( ${!configvarname} )
|
||||||
for v in "${configvarname[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for v in ${configvarname[@]}
|
||||||
do
|
do
|
||||||
read_config_param "$v"
|
read_config_param "$v"
|
||||||
done
|
done
|
||||||
|
@ -90,7 +91,8 @@ function app_save_variables {
|
||||||
|
|
||||||
#shellcheck disable=SC2206
|
#shellcheck disable=SC2206
|
||||||
configvarname=( ${!configvarname} )
|
configvarname=( ${!configvarname} )
|
||||||
for v in "${configvarname[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for v in ${configvarname[@]}
|
||||||
do
|
do
|
||||||
write_config_param "$v" "${!v}"
|
write_config_param "$v" "${!v}"
|
||||||
done
|
done
|
||||||
|
@ -128,9 +130,10 @@ function available_system_variants {
|
||||||
system_variants_list=$(app_variants "$filename")
|
system_variants_list=$(app_variants "$filename")
|
||||||
# shellcheck disable=SC2206
|
# shellcheck disable=SC2206
|
||||||
variants_array=($system_variants_list)
|
variants_array=($system_variants_list)
|
||||||
for variant_str in "${variants_array[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for variant_str in ${variants_array[@]}
|
||||||
do
|
do
|
||||||
if ! item_in_array "${variant_str}" "${new_available_variants_list[@]}"; then
|
if ! item_in_array "${variant_str}" ${new_available_variants_list[@]}; then
|
||||||
new_available_variants_list+=("$variant_str")
|
new_available_variants_list+=("$variant_str")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -146,7 +149,8 @@ function is_valid_variant {
|
||||||
function_check available_system_variants
|
function_check available_system_variants
|
||||||
available_system_variants
|
available_system_variants
|
||||||
|
|
||||||
for variant_str in "${available_variants_list[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for variant_str in ${available_variants_list[@]}
|
||||||
do
|
do
|
||||||
if [[ "$sys_type" == "$variant_str" ]]; then
|
if [[ "$sys_type" == "$variant_str" ]]; then
|
||||||
return "1"
|
return "1"
|
||||||
|
@ -161,7 +165,8 @@ function show_available_variants {
|
||||||
function_check available_system_variants
|
function_check available_system_variants
|
||||||
available_system_variants
|
available_system_variants
|
||||||
|
|
||||||
for variant_str in "${available_variants_list[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for variant_str in ${available_variants_list[@]}
|
||||||
do
|
do
|
||||||
echo " $variant_str"
|
echo " $variant_str"
|
||||||
done
|
done
|
||||||
|
@ -250,7 +255,8 @@ function install_completed {
|
||||||
|
|
||||||
# populates an array of "0" or "1" for whether apps are installed
|
# populates an array of "0" or "1" for whether apps are installed
|
||||||
function get_apps_installed {
|
function get_apps_installed {
|
||||||
for a in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
APPS_INSTALLED+=("$(app_is_installed "$a")")
|
APPS_INSTALLED+=("$(app_is_installed "$a")")
|
||||||
done
|
done
|
||||||
|
@ -259,7 +265,8 @@ function get_apps_installed {
|
||||||
# populates an array of installed app names
|
# populates an array of installed app names
|
||||||
function get_apps_installed_names {
|
function get_apps_installed_names {
|
||||||
APPS_INSTALLED_NAMES=()
|
APPS_INSTALLED_NAMES=()
|
||||||
for a in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
if [[ $(app_is_installed "$a") == "1" ]]; then
|
if [[ $(app_is_installed "$a") == "1" ]]; then
|
||||||
APPS_INSTALLED_NAMES+=("$a")
|
APPS_INSTALLED_NAMES+=("$a")
|
||||||
|
@ -281,7 +288,8 @@ function detect_apps {
|
||||||
do
|
do
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
|
||||||
if ! item_in_array "${app_name}" "${APPS_AVAILABLE[@]}"; then
|
# shellcheck disable=SC2068
|
||||||
|
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
||||||
APPS_AVAILABLE+=("${app_name}")
|
APPS_AVAILABLE+=("${app_name}")
|
||||||
APPS_CHOSEN+=("0")
|
APPS_CHOSEN+=("0")
|
||||||
fi
|
fi
|
||||||
|
@ -312,7 +320,8 @@ function detect_installable_apps {
|
||||||
do
|
do
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
|
||||||
if ! item_in_array "${app_name}" "${APPS_AVAILABLE[@]}"; then
|
# shellcheck disable=SC2068
|
||||||
|
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
||||||
variants_list=$(app_variants "$filename")
|
variants_list=$(app_variants "$filename")
|
||||||
# check for empty string
|
# check for empty string
|
||||||
if [ ${#variants_list} -gt 0 ]; then
|
if [ ${#variants_list} -gt 0 ]; then
|
||||||
|
@ -344,7 +353,8 @@ function detect_installed_apps {
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
|
||||||
if [[ $(app_is_installed "$app_name") == "1" ]]; then
|
if [[ $(app_is_installed "$app_name") == "1" ]]; then
|
||||||
if ! item_in_array "${app_name}" "${APPS_AVAILABLE[@]}"; then
|
# shellcheck disable=SC2068
|
||||||
|
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
||||||
variants_list=$(app_variants "$filename")
|
variants_list=$(app_variants "$filename")
|
||||||
if [ ${#variants_list} -gt 0 ]; then
|
if [ ${#variants_list} -gt 0 ]; then
|
||||||
APPS_AVAILABLE+=("${app_name}")
|
APPS_AVAILABLE+=("${app_name}")
|
||||||
|
@ -378,7 +388,8 @@ function choose_apps_for_variant {
|
||||||
do
|
do
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
|
||||||
if item_in_array "${app_name}" "${APPS_AVAILABLE[@]}"; then
|
# shellcheck disable=SC2068
|
||||||
|
if item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
||||||
if grep -q "VARIANTS=" "${filename}"; then
|
if grep -q "VARIANTS=" "${filename}"; then
|
||||||
variants_list=$(app_variants "$filename")
|
variants_list=$(app_variants "$filename")
|
||||||
if [[ "${variants_list}" == 'all'* || \
|
if [[ "${variants_list}" == 'all'* || \
|
||||||
|
@ -408,7 +419,8 @@ function choose_apps_for_variant {
|
||||||
# show a list of apps which have been chosen
|
# show a list of apps which have been chosen
|
||||||
function list_chosen_apps {
|
function list_chosen_apps {
|
||||||
app_index=0
|
app_index=0
|
||||||
for a in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
|
if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
|
||||||
echo $"${a}"
|
echo $"${a}"
|
||||||
|
@ -419,7 +431,8 @@ function list_chosen_apps {
|
||||||
|
|
||||||
function remove_apps {
|
function remove_apps {
|
||||||
app_index=0
|
app_index=0
|
||||||
for a in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then
|
if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then
|
||||||
if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
|
if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
|
||||||
|
@ -450,7 +463,8 @@ function remove_apps {
|
||||||
function install_apps_interactive {
|
function install_apps_interactive {
|
||||||
echo $"Interactive installer"
|
echo $"Interactive installer"
|
||||||
app_index=0
|
app_index=0
|
||||||
for a in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
|
if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
|
||||||
if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
|
if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
|
||||||
|
@ -546,7 +560,8 @@ function install_apps {
|
||||||
|
|
||||||
# now install the apps
|
# now install the apps
|
||||||
app_index=0
|
app_index=0
|
||||||
for a in "${APPS_AVAILABLE[@]}"
|
# shellcheck disable=SC2068
|
||||||
|
for a in ${APPS_AVAILABLE[@]}
|
||||||
do
|
do
|
||||||
if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
|
if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
|
||||||
if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
|
if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
|
||||||
|
|
|
@ -1105,7 +1105,8 @@ function upgrade_apps {
|
||||||
do
|
do
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
|
||||||
if ! item_in_array "${app_name}" "${APPS_COMPLETED[@]}"; then
|
# shellcheck disable=SC2068
|
||||||
|
if ! item_in_array "${app_name}" ${APPS_COMPLETED[@]}; then
|
||||||
function_check app_is_installed
|
function_check app_is_installed
|
||||||
if [[ "$(app_is_installed "$app_name")" == "1" ]]; then
|
if [[ "$(app_is_installed "$app_name")" == "1" ]]; then
|
||||||
echo ''
|
echo ''
|
||||||
|
|
Loading…
Reference in New Issue