2016-08-13 01:08:44 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Purge l'ensemble de la config lxc pour les conteneurs de demo.
|
|
|
|
# Il sera nécessaire de lancer le script demo_lxc_build_init.sh pour réinstaller l'ensemble le cas échéant.
|
|
|
|
|
|
|
|
# Récupère le dossier du script
|
2016-09-18 19:23:54 +02:00
|
|
|
if [ "${0:0:1}" == "/" ]; then script_dir="$(dirname "$0")"; else script_dir="$(echo $PWD/$(dirname "$0" | cut -d '.' -f2) | sed 's@/$@@')"; fi
|
2016-08-13 01:08:44 +02:00
|
|
|
|
2022-10-13 05:46:46 +02:00
|
|
|
source $script_dir/ynh_lxd
|
2022-11-05 20:15:50 +01:00
|
|
|
source $script_dir/ynh_lxd_demo
|
2022-10-13 05:46:46 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-08-16 15:36:12 +02:00
|
|
|
|
2022-10-13 05:46:46 +02:00
|
|
|
app=${__APP__:-yunohost_demo}
|
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
|
|
lxc_name1=$(ynh_app_setting_get --app=$app --key=lxc_name1)
|
|
|
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
2016-08-13 01:08:44 +02:00
|
|
|
|
2022-11-06 19:02:46 +01:00
|
|
|
echo_bold () {
|
|
|
|
echo -e "\e[1m$1\e[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
|
|
|
|
function remove_yunohost_demo() {
|
|
|
|
echo_bold "> Installation of yunohost_demo..."
|
|
|
|
if yunohost app list --output-as json --quiet | jq -e '.apps[] | select(.id == "yunohost_demo")' >/dev/null
|
|
|
|
then
|
|
|
|
yunohost app remove yunohost_demo --purge
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# =========================
|
|
|
|
# Main stuff
|
|
|
|
# =========================
|
|
|
|
|
|
|
|
remove_yunohost_demo
|
|
|
|
|
|
|
|
echo "Done!"
|
|
|
|
echo " "
|