prompt the user as well after having displayed path
This commit is contained in:
parent
9e8b1bcd12
commit
4ef81da240
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user