From b94c117d2bd4659cc969f65fe7eab68ef1abdb15 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 14 Oct 2022 05:02:08 +0200 Subject: [PATCH] Cleanup --- demo_lxc_build.sh | 84 +++++++++++++++++++++--------------------- demo_lxc_build_init.sh | 18 ++++----- demo_lxc_destroy.sh | 6 +-- demo_lxc_remove.sh | 4 +- demo_restore_crash.sh | 14 +++---- 5 files changed, 63 insertions(+), 63 deletions(-) diff --git a/demo_lxc_build.sh b/demo_lxc_build.sh index 8b8aa23..ce5a3f9 100755 --- a/demo_lxc_build.sh +++ b/demo_lxc_build.sh @@ -34,90 +34,90 @@ LOG_BUILD_LXC="$final_path/$LOG" if $(ynh_lxc_exists --name="$name") then # Si le conteneur existe déjà - ynh_print_info --message="\e[1m> Suppression du conteneur existant.\e[0m" | tee -a "$LOG_BUILD_LXC" + ynh_print_info --message="> Suppression du conteneur existant." | tee -a "$LOG_BUILD_LXC" /bin/bash "$final_path/demo_lxc_destroy.sh" quiet | tee -a "$LOG_BUILD_LXC" fi -ynh_print_info --message="\e[1m> Création d'une machine debian $DIST minimaliste\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Création d'une machine debian $DIST minimaliste" | tee -a "$LOG_BUILD_LXC" ynh_lxc_create --image="$lxc_base" --name="$lxc_name1" | tee -a "$LOG_BUILD_LXC" 2>&1 -ynh_print_info --message= "\e[1m> Active le bridge réseau\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message= "> Active le bridge réseau" | tee -a "$LOG_BUILD_LXC" lxc network attach $lxdbr_demo_name $lxc_name1 eth1 eth1 | tee -a "$LOG_BUILD_LXC" 2>&1 -ynh_print_info --message="\e[1m> Configuration réseau de la machine virtualisée\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Configuration réseau de la machine virtualisée" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="cp /etc/systemd/network/eth0.network /etc/systemd/network/eth1.network" ynh_lxc_run_inside --name="$lxc_name1" --command="sed -i s/eth0/eth1/g /etc/systemd/network/eth1.network" -ynh_print_info --message="\e[1m> Update de la machine virtualisée\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Update de la machine virtualisée" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="apt-get -y update" ynh_lxc_run_inside --name="$lxc_name1" --command="apt-get -y full-upgrade" ynh_lxc_run_inside --name="$lxc_name1" --command="apt-get -y autoremove" ynh_lxc_run_inside --name="$lxc_name1" --command="apt-get -y clean" -ynh_print_info --message="\e[1m> Post install Yunohost\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Post install Yunohost" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost tools postinstall --domain $domain --password $yunohost_password --force-password" | tee -a "$LOG_BUILD_LXC" 2>&1 -ynh_print_info --message="\e[1m> Disable password strength\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Disable password strength" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost settings set security.password.user.strength -v -1" | tee -a "$LOG_BUILD_LXC" -ynh_print_info --message="\e[1m> Ajout de l'utilisateur de demo\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Ajout de l'utilisateur de demo" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost user create $demo_user --firstname $demo_user --lastname $demo_user --domain $domain --password $demo_password" | tee -a "$LOG_BUILD_LXC" -ynh_print_info --message="\e[1m\n> Vérification de l'état de Yunohost\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Vérification de l'état de Yunohost" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost -v" | tee -a "$LOG_BUILD_LXC" 2>&1 # ******** -ynh_print_info --message="\e[1m>> Modification de Yunohost pour la demo\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Modification de Yunohost pour la demo" | tee -a "$LOG_BUILD_LXC" # App officielles -ynh_print_info --message="\e[1m> Installation des applications officielles\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Installation des applications officielles" | tee -a "$LOG_BUILD_LXC" # Ampache -ynh_print_info --message="\e[36mInstallation de Ampache\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de Ampache" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install ampache --force --args \"domain=$domain&path=/ampache&admin=$demo_user&is_public=1&\"" | tee -a "$LOG_BUILD_LXC" # Baikal -ynh_print_info --message="\e[36mInstallation de baikal\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de baikal" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install baikal --force --args \"domain=$domain&path=/baikal&password=$demo_password&\"" | tee -a "$LOG_BUILD_LXC" # Agendav -ynh_print_info --message="\e[36mInstallation d'agendav\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation d'agendav" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install agendav --force --args \"domain=$domain&path=/agendav&language=en&\"" | tee -a "$LOG_BUILD_LXC" # Dokuwiki -ynh_print_info --message="\e[36mInstallation de dokuwiki\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de dokuwiki" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install dokuwiki --force --args \"domain=$domain&path=/dokuwiki&admin=$demo_user&is_public=1&language=en&\"" | tee -a "$LOG_BUILD_LXC" # Etherpad -ynh_print_info --message="\e[36mInstallation de etherpad\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de etherpad" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install etherpad_mypads --force --args \"domain=$domain&path=/etherpad&admin=$demo_user&password=administration&language=en&is_public=1&export=none&mypads=1&useldap=0&\"" | tee -a "$LOG_BUILD_LXC" # Hextris -ynh_print_info --message="\e[36mInstallation de hextris\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de hextris" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install hextris --force --args \"domain=$domain&path=/hextris&is_public=1&\"" | tee -a "$LOG_BUILD_LXC" # Jirafeau -ynh_print_info --message="\e[36mInstallation de jirafeau\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de jirafeau" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install jirafeau --force --args \"domain=$domain&path=/jirafeau&admin_user=$demo_user&upload_password=$demo_password&is_public=1&\"" | tee -a "$LOG_BUILD_LXC" # Kanboard -ynh_print_info --message="\e[36mInstallation de kanboard\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de kanboard" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install kanboard --force --args \"domain=$domain&path=/kanboard&admin=$demo_user&is_public=1&\"" | tee -a "$LOG_BUILD_LXC" # Nextcloud -ynh_print_info --message="\e[36mInstallation de nextcloud\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de nextcloud" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install nextcloud --force --args \"domain=$domain&path=/nextcloud&admin=$demo_user&user_home=0&is_public=1&\"" | tee -a "$LOG_BUILD_LXC" # Opensondage -ynh_print_info --message="\e[36mInstallation de opensondage\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de opensondage" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install opensondage --force --args \"domain=$domain&path=/date&admin=$demo_user&language=en&is_public=1&\"" | tee -a "$LOG_BUILD_LXC" # Phpmyadmin -ynh_print_info --message="\e[36mInstallation de phpmyadmin\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de phpmyadmin" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install phpmyadmin --force --args \"domain=$domain&path=/phpmyadmin&admin=$demo_user&\"" | tee -a "$LOG_BUILD_LXC" # Piwigo -ynh_print_info --message="\e[36mInstallation de piwigo\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de piwigo" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install piwigo --force --args \"domain=$domain&path=/piwigo&admin=$demo_user&is_public=1&language=en&\"" | tee -a "$LOG_BUILD_LXC" # Rainloop -ynh_print_info --message="\e[36mInstallation de rainloop\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de rainloop" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install rainloop --force --args \"domain=$domain&path=/rainloop&is_public=No&password=$demo_password&ldap=Yes&language=en&\"" | tee -a "$LOG_BUILD_LXC" # Roundcube -ynh_print_info --message="\e[36mInstallation de roundcube\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de roundcube" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install roundcube --force --args \"domain=$domain&path=/webmail&with_carddav=0&with_enigma=0&language=en_GB&\"" | tee -a "$LOG_BUILD_LXC" # Searx -ynh_print_info --message="\e[36mInstallation de searx\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de searx" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install searx --force --args \"domain=$domain&path=/searx&is_public=1&\"" | tee -a "$LOG_BUILD_LXC" # Shellinabox -ynh_print_info --message="\e[36mInstallation de shellinabox\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de shellinabox" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install shellinabox --force --args \"domain=$domain&path=/ssh&\"" | tee -a "$LOG_BUILD_LXC" # Désactive l'accès à shellinabox ynh_lxc_run_inside --name="$lxc_name1" --command="rm /etc/nginx/conf.d/$domain.d/shellinabox.conf" @@ -125,51 +125,51 @@ ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app setting shellinab ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app setting shellinabox domain -d" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app ssowatconf" # Strut -ynh_print_info --message="\e[36mInstallation de strut\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de strut" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install strut --force --args \"domain=$domain&path=/strut&is_public=1&\"" | tee -a "$LOG_BUILD_LXC" # Transmission -ynh_print_info --message="\e[36mInstallation de transmission\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de transmission" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install transmission --force --args \"domain=$domain&path=/torrent&\"" | tee -a "$LOG_BUILD_LXC" # Ttrss -ynh_print_info --message="\e[36mInstallation de ttrss\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de ttrss" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install ttrss --force --args \"domain=$domain&path=/ttrss&is_public=1&\"" | tee -a "$LOG_BUILD_LXC" # Wallabag -ynh_print_info --message="\e[36mInstallation de wallabag\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de wallabag" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install wallabag2 --force --args \"domain=$domain&path=/wallabag&admin=$demo_user&\"" | tee -a "$LOG_BUILD_LXC" # Wordpress -ynh_print_info --message="\e[36mInstallation de wordpress\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de wordpress" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install wordpress --force --args \"domain=$domain&path=/blog&admin=$demo_user&language=en_US&multisite=0&is_public=1&\"" | tee -a "$LOG_BUILD_LXC" # Zerobin -ynh_print_info --message="\e[36mInstallation de zerobin\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="Installation de zerobin" | tee -a "$LOG_BUILD_LXC" ynh_lxc_run_inside --name="$lxc_name1" --command="yunohost app install zerobin --force --args \"domain=$domain&path=/zerobin&is_public=1&\"" | tee -a "$LOG_BUILD_LXC" # ******** -ynh_print_info --message="\e[1m> Création d'un snapshot\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Création d'un snapshot" | tee -a "$LOG_BUILD_LXC" ynh_lxc_create_snapshot --name="$lxc_name1" --snapname="snap0" -ynh_print_info --message="\e[1m> Mise à jour de la machine virtualisée\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Mise à jour de la machine virtualisée" | tee -a "$LOG_BUILD_LXC" ynh_lxc_stop --name="$lxc_name1" | tee -a "$LOG_BUILD_LXC" 2>&1 ynh_lxc_upgrade_demo --name=$lxc_name1 --time_to_switch=$time_to_switch -ynh_print_info --message="\e[1m> Clone la machine\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Clone la machine" | tee -a "$LOG_BUILD_LXC" lxc copy "$lxc_name1" "$lxc_name2" | tee -a "$LOG_BUILD_LXC" 2>&1 -ynh_print_info --message="\e[1m> Création d'un snapshot\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Création d'un snapshot" | tee -a "$LOG_BUILD_LXC" ynh_lxc_create_snapshot --name="$lxc_name2" --snapname="snap0" -ynh_print_info --message="\e[1m> Mise en place du cron de switch\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Mise en place du cron de switch" | tee -a "$LOG_BUILD_LXC" ynh_add_config --template="$final_path/conf/cron_demo_switch" --destination="/etc/cron.d/demo_switch" -ynh_print_info --message="\e[1m> Et du cron d'upgrade\e[0m" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Et du cron d'upgrade" | tee -a "$LOG_BUILD_LXC" ynh_add_config --template="$final_path/conf/cron_demo_upgrade" --destination="/etc/cron.d/demo_upgrade" -ynh_print_info --message="e[1m> Mise en place du service" | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Mise en place du service" | tee -a "$LOG_BUILD_LXC" #ynh_add_systemd_config --template="$final_path/conf/systemd.service" ynh_add_systemd_config -ynh_print_info --message="e[1m> Integrating service in YunoHost..." | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Integrating service in YunoHost..." | tee -a "$LOG_BUILD_LXC" yunohost service add $app --log="/var/log/$app/$app.log" -ynh_print_info --message="e[1m> Starting a systemd service..." | tee -a "$LOG_BUILD_LXC" +ynh_print_info --message="> Starting a systemd service..." | tee -a "$LOG_BUILD_LXC" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" diff --git a/demo_lxc_build_init.sh b/demo_lxc_build_init.sh index 7e178b0..3909895 100755 --- a/demo_lxc_build_init.sh +++ b/demo_lxc_build_init.sh @@ -23,15 +23,15 @@ echo "$DOMAIN" > "$script_dir/domain.ini" # Créer le dossier de log sudo mkdir -p $(dirname $LOG_BUILD_LXC) -echo -e "\e[1m> Update et install lxc, lxctl et mailutils\e[0m" | tee "$LOG_BUILD_LXC" +echo -e "> Update et install lxc, lxctl et mailutils" | tee "$LOG_BUILD_LXC" sudo apt-get update | tee -a "$LOG_BUILD_LXC" 2>&1 sudo apt-get install -y lxc lxctl mailutils certbot | tee -a "$LOG_BUILD_LXC" 2>&1 -echo -e "\e[1m> Autoriser l'ip forwarding, pour router vers la machine virtuelle.\e[0m" | tee -a "$LOG_BUILD_LXC" +echo -e "> Autoriser l'ip forwarding, pour router vers la machine virtuelle." | tee -a "$LOG_BUILD_LXC" echo "net.ipv4.ip_forward=1" | sudo tee /etc/sysctl.d/lxc_demo.conf | tee -a "$LOG_BUILD_LXC" 2>&1 sudo sysctl -p /etc/sysctl.d/lxc_demo.conf | tee -a "$LOG_BUILD_LXC" 2>&1 -echo -e "\e[1m> Ajoute un brige réseau pour la machine virtualisée\e[0m" | tee -a "$LOG_BUILD_LXC" +echo -e "> Ajoute un brige réseau pour la machine virtualisée" | tee -a "$LOG_BUILD_LXC" echo | sudo tee /etc/network/interfaces.d/lxc_demo <&1 auto lxc_demo iface lxc_demo inet static @@ -41,10 +41,10 @@ iface lxc_demo inet static bridge_maxwait 0 EOF -echo -e "\e[1m> Active le bridge réseau\e[0m" | tee -a "$LOG_BUILD_LXC" +echo -e "> Active le bridge réseau" | tee -a "$LOG_BUILD_LXC" sudo ifup lxc_demo --interfaces=/etc/network/interfaces.d/lxc_demo | tee -a "$LOG_BUILD_LXC" 2>&1 -echo -e "\e[1m> Mise en place de la connexion ssh vers l'invité.\e[0m" | tee -a "$LOG_BUILD_LXC" +echo -e "> Mise en place de la connexion ssh vers l'invité." | tee -a "$LOG_BUILD_LXC" if [ -e $HOME/.ssh/$lxc_name1 ]; then rm -f $HOME/.ssh/$lxc_name1 $HOME/.ssh/$lxc_name1.pub ssh-keygen -f $HOME/.ssh/known_hosts -R $lxdbr_demo_network$lxc_ip1 @@ -65,7 +65,7 @@ IdentityFile $HOME/.ssh/$lxc_name1 # End ssh $lxc_name1 EOF -echo -e "\e[1m> Mise en place du reverse proxy et du load balancing\e[0m" | tee -a "$LOG_BUILD_LXC" +echo -e "> Mise en place du reverse proxy et du load balancing" | tee -a "$LOG_BUILD_LXC" echo | sudo tee /etc/nginx/conf.d/$DOMAIN.conf <&1 #upstream $DOMAIN { # server $lxdbr_demo_network$lxc_ip1:443 ; @@ -89,7 +89,7 @@ EOF sudo service nginx reload -echo -e "\e[1m> Création du certificat SSL.\e[0m" | tee -a "$LOG_BUILD_LXC" +echo -e "> Création du certificat SSL." | tee -a "$LOG_BUILD_LXC" sudo mkdir -p /etc/letsencrypt # Créer le fichier de config @@ -181,8 +181,8 @@ EOF sudo service nginx reload -echo -e "\e[1mLe serveur est prêt à déployer les conteneurs de demo.\e[0m" -echo -e "\e[1mExécutez le script demo_lxc_build.sh pour créer les conteneurs et mettre en place la demo.\e[0m" +echo -e "Le serveur est prêt à déployer les conteneurs de demo." +echo -e "Exécutez le script demo_lxc_build.sh pour créer les conteneurs et mettre en place la demo." # Déploie les conteneurs de demo # "$script_dir/demo_lxc_build.sh" diff --git a/demo_lxc_destroy.sh b/demo_lxc_destroy.sh index 1fbb555..575b34b 100755 --- a/demo_lxc_destroy.sh +++ b/demo_lxc_destroy.sh @@ -19,17 +19,17 @@ lxc_ip2=$(ynh_app_setting_get --app=$app --key=lxc_ip2) /bin/bash "$final_path/demo_stop.sh" -f -ynh_print_info --message="\e[1m> Suppression des conteneurs et de leur snapshots\e[0m" +ynh_print_info --message="> Suppression des conteneurs et de leur snapshots" ynh_secure_remove --file="/var/lib/lxd/snapshots/$lxc_name1/snap0.tar.gz" ynh_lxc_delete --name=$lxc_name1 ynh_secure_remove --file="/var/lib/lxd/snapshots/$lxc_name2/snap0.tar.gz" ynh_lxc_delete --name=$lxc_name2 -ynh_print_info --message="\e[1m> Suppression des crons\e[0m" +ynh_print_info --message="> Suppression des crons" ynh_secure_remove --file=/etc/cron.d/demo_switch ynh_secure_remove --file=/etc/cron.d/demo_upgrade -ynh_print_info --message="\e[1m> Suppression du service\e[0m" +ynh_print_info --message="> Suppression du service" if ynh_exec_warn_less yunohost service status $app >/dev/null then ynh_print_info --message="Removing $app service integration..." diff --git a/demo_lxc_remove.sh b/demo_lxc_remove.sh index a711611..a3e60e0 100755 --- a/demo_lxc_remove.sh +++ b/demo_lxc_remove.sh @@ -17,12 +17,12 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) /bin/bash "$final_path/demo_lxc_destroy.sh" # Suppression du reverse proxy -echo -e "\e[1m> Suppression de la config nginx\e[0m" +echo -e "> Suppression de la config nginx" sudo rm /etc/nginx/conf.d/$DOMAIN.conf sudo service nginx reload # Suppression du certificat Let's encrypt -echo -e "\e[1m> Suppression de Let's encrypt\e[0m" +echo -e "> Suppression de Let's encrypt" sudo rm -r /etc/letsencrypt sudo rm -r ~/.local/share/letsencrypt sudo rm -r ~/letsencrypt diff --git a/demo_restore_crash.sh b/demo_restore_crash.sh index fd5a52b..76d8478 100755 --- a/demo_restore_crash.sh +++ b/demo_restore_crash.sh @@ -36,14 +36,14 @@ ynh_lxc_check_container_start --name=$lxc_name2 LXC2_STATUS=$? if [ $LXC1_STATUS -eq 1 ]; then - ynh_print_info --message="\e[91m> Conteneur $lxc_name1 en défaut.\e[0m" + ynh_print_info --message="> Conteneur $lxc_name1 en défaut." else - ynh_print_info --message="\e[92m> Conteneur $lxc_name1 en état de marche.\e[0m" + ynh_print_info --message="> Conteneur $lxc_name1 en état de marche." fi if [ $LXC2_STATUS -eq 1 ]; then - ynh_print_info --message="\e[91m> Conteneur $lxc_name2 en défaut.\e[0m" + ynh_print_info --message="> Conteneur $lxc_name2 en défaut." else - ynh_print_info --message="\e[92m> Conteneur $lxc_name2 en état de marche.\e[0m" + ynh_print_info --message="> Conteneur $lxc_name2 en état de marche." fi # Restauration des snapshots @@ -79,13 +79,13 @@ fi # Résultats finaux if [ $LXC1_STATUS -eq 1 ] || [ $LXC2_STATUS -eq 1 ]; then if [ $LXC1_STATUS -eq 1 ]; then - ynh_print_info --message="\e[91m\n> Le conteneur $lxc_name1 n'a pas pu être réparé...\e[0m" + ynh_print_info --message="> Le conteneur $lxc_name1 n'a pas pu être réparé..." fi if [ $LXC2_STATUS -eq 1 ]; then - ynh_print_info --message="\e[91m\n> Le conteneur $lxc_name2 n'a pas pu être réparé...\e[0m" + ynh_print_info --message="> Le conteneur $lxc_name2 n'a pas pu être réparé..." fi else - ynh_print_info --message="\e[92m\n> Les 2 conteneurs sont sains et fonctionnels.\e[0m" + ynh_print_info --message="> Les 2 conteneurs sont sains et fonctionnels." fi ynh_print_info --message="Réactive le cron switch."