prompt the user as well after having displayed path

This commit is contained in:
Meliox 2024-06-15 22:40:24 +02:00
parent 9e8b1bcd12
commit 4ef81da240

View File

@ -782,9 +782,20 @@ function save_sensors_data {
# Check if command exists # Check if command exists
if (command -v sensors &>/dev/null); then if (command -v sensors &>/dev/null); then
# Save sensors output # Save sensors output
local filepath="$DEBUG_SAVE_PATH/$DEBUG_SAVE_FILENAME" local filepath="${DEBUG_SAVE_PATH}/${DEBUG_SAVE_FILENAME}"
echo "Sensors data will be saved in $filepath"
# Prompt user for confirmation
read -p "Do you wish to continue? (y/n): " choice
case "$choice" in
y|Y )
sensors -j > "$filepath" sensors -j > "$filepath"
msgb "Sensors data saved in $filepath" msgb "Sensors data saved in $filepath"
;;
* )
echo "Operation cancelled by user."
;;
esac
else else
err "Sensors is not installed. No file could be saved" err "Sensors is not installed. No file could be saved"
fi fi