diff --git a/scripts/actions/list_all_pads b/scripts/actions/list_all_pads index 9c10137..782a93c 100755 --- a/scripts/actions/list_all_pads +++ b/scripts/actions/list_all_pads @@ -41,7 +41,14 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_script_progression --message="Listing all pads..." --weight=3 -mysql -u $db_name -p$db_pwd $db_name --silent -e 'select distinct substring(store.key,5,locate(":",store.key,5)-5) as "pads" from store where store.key like "pad:%"' | sed 's/^/>> /g' >&2 +# Get the list of pads from the database +pad_list="$(ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< \ + "select distinct substring(store.key,5,locate(\":\",store.key,5)-5) as \"pads\" from store where store.key like \"pad:%\"")" + +# Remove empty lines +# Name the first line "> List of pads" +# Then for the second lines and following, add >> before the name of the pad. +ynh_print_info --message="$(echo "$pad_list" | sed '/^$/d' | sed '1 s/^/> List of /' | sed '2,$s/^/>> /g')" #================================================= # END OF SCRIPT diff --git a/scripts/actions/reset_default_config b/scripts/actions/reset_default_config index d6b9782..19936da 100755 --- a/scripts/actions/reset_default_config +++ b/scripts/actions/reset_default_config @@ -58,12 +58,16 @@ then ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/settings.json" if [ "$export" = "abiword" ] then - abiword_path=`which abiword` # Get abiword binary path - ynh_replace_string --match_string="\"abiword\" : null" --replace_string="\"abiword\" : \"$abiword_path\"" --target_file="$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad + # Get abiword binary path + abiword_path=`which abiword` + # Set the path of abiword into etherpad config + ynh_replace_string --match_string="\"abiword\" : null" --replace_string="\"abiword\" : \"$abiword_path\"" --target_file="$final_path/settings.json" elif [ "$export" = "libreoffice" ] then - soffice_path=`which soffice` # Get soffice binary path - ynh_replace_string --match_string="\"soffice\" : null" --replace_string="\"soffice\" : \"$soffice_path\"" --target_file="$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad + # Get soffice binary path + soffice_path=`which soffice` + # Set the path of soffice into etherpad config + ynh_replace_string --match_string="\"soffice\" : null" --replace_string="\"soffice\" : \"$soffice_path\"" --target_file="$final_path/settings.json" fi ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/settings.json"