cloudron-support: make user press enter

This commit is contained in:
Girish Ramakrishnan
2025-06-15 13:08:54 +02:00
parent 39cbfb84ae
commit 2d5ef36a7f

View File

@@ -17,7 +17,7 @@ readonly PASTEBIN="https://paste.cloudron.io"
readonly LINE="\n========================================================\n"
readonly HELP_MESSAGE="
Cloudron Support and Diagnostics Tool
See https://docs.cloudron.io/troubleshooting for more information on troubleshooting.
Options:
@@ -582,21 +582,21 @@ function troubleshoot() {
}
function cleanup_disk_space() {
read -p "Truncate log files to reclaim space ? (y/N) " -n 1 -r choice
echo -e "\n"
read -p "Truncate log files to reclaim space? [y/N] " choice
choice=${choice:-n}
if [[ $choice =~ ^[Yy]$ ]]; then
truncate -s0 /home/yellowtent/platformdata/logs/*/*.log
rm -f /home/yellowtent/platformdata/logs/*.log.* # delete the log.1, log.2 etc
fi
read -p "Prune docker system resources to reclaim space ? (y/N) " -n 1 -r choice
echo -e "\n"
read -p "Prune docker system resources to reclaim space? [y/N] " choice
choice=${choice:-n}
if [[ $choice =~ ^[Yy]$ ]]; then
docker images prune -fa || true
fi
read -p "Prune docker volumes to reclaim space ? (y/N) " -n 1 -r choice
echo -e "\n"
read -p "Prune docker volumes to reclaim space? [y/N] " choice
choice=${choice:-n}
if [[ $choice =~ ^[Yy]$ ]]; then
for container in $(docker ps --format "{{.ID}}"); do
docker exec "$container" find /tmp -type f -mtime +1 -delete || true
@@ -649,8 +649,8 @@ function recreate_containers() {
readonly logfile="/home/yellowtent/platformdata/logs/box.log"
echo "This will re-create all the containers. Apps will go down for a while. No data will be lost."
read -p "Do you want to proceed? (y/N) " -n 1 -r choice
echo
read -p "Do you want to proceed? [y/N] " choice
choice=${choice:-n}
[[ ! $choice =~ ^[Yy]$ ]] && exit 1
@@ -669,8 +669,8 @@ function download_docker_images() {
}
function ask_reboot() {
read -p "Do you want to reboot ? (y/N) " -n 1 -r choice
echo -e "\n"
read -p "Do you want to reboot ? [y/N] " choice
choice=${choice:-n}
[[ ! $choice =~ ^[Yy]$ ]] && exit 1
reboot
@@ -692,8 +692,8 @@ function recreate_docker() {
echo "the docker storage, re-download docker images and re-create containers. Dashboard and apps"
echo -e "will be unreachable for a while. No data will be lost.\n"
echo -e "The server may have to be rebooted twice for this. If so, re-run this command after every reboot.\n"
read -p "Do you want to proceed? (y/N) " -n 1 -r choice
echo -e "\n"
read -p "Do you want to proceed? [y/N] " choice
choice=${choice:-n}
[[ ! $choice =~ ^[Yy]$ ]] && exit 1
@@ -767,8 +767,8 @@ function apply_patch() {
fi
echo "This will apply ${commit_id} (${patch_file}) from git and restart the box code."
warn "Do not proceed unless you know what you are doing."
read -p "Do you want to apply the patch ? (y/N) " -n 1 -r choice
echo -e "\n"
read -p "Do you want to apply the patch? [y/N] " choice
choice=${choice:-n}
[[ ! $choice =~ ^[Yy]$ ]] && exit 1