Skip to content
Snippets Groups Projects
Commit 2f952f6f authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Merge branch 'pierreozoux-patch-1' into 'master'

Adds a delete command.

See merge request libre.sh/compose.libre.sh!179
parents fab6a854 40e537ff
No related branches found
No related tags found
No related merge requests found
...@@ -61,6 +61,23 @@ case "$1" in ...@@ -61,6 +61,23 @@ case "$1" in
provision ${@:2};; provision ${@:2};;
stats) stats)
docker stats $(docker ps|grep -v "NAMES"|awk '{ print $NF }'|tr "\n" " ");; docker stats $(docker ps|grep -v "NAMES"|awk '{ print $NF }'|tr "\n" " ");;
delete)
read -p "Are you sure you want to delete ${2}? (yY)" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
cd /data/domains/${2}
libre stop
libre disable
cd /data/domains
tar cvzf ${2}.tgz ./${2}
if [ -f ./${2}.tgz ]; then
mv ${2}.tgz /data/domains/to_keep/
rm -rf /data/domains/${2}
rm -rf /system/haproxy/certs/${2}
rm /system/haproxy/haproxy/certs/${2}.pem
fi
fi;;
*) *)
echo "Usage:" echo "Usage:"
echo " - start|status|enable|disable|restart|stop: command sent to systemctl." echo " - start|status|enable|disable|restart|stop: command sent to systemctl."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment