extras/gtomb again: sudo no longer stored in variable.

This commit is contained in:
nerun 2023-01-15 15:44:42 -03:00 committed by Jaromil
parent d65a3f1586
commit 5eaa92e614

View File

@ -21,7 +21,7 @@
# {{{ SETTINGS # {{{ SETTINGS
ver="0.9" ver="0.9"
KDFPATH="/usr/libexec/tomb" # Path of your KDF binaries (if you're using them). KDFPATH="/usr/libexec/tomb" # Path of your KDF binaries (if you're using them).
SWAPOFF="false" # Set to "true" to swapoff, or "false" to use -f (force) flag. SWAPOFF="true" # Set to "true" to swapoff, or "false" to use -f (force) flag.
# The ones below should not need changing # The ones below should not need changing
TOMBPATH="$(which tomb)" # Tomb executable's path TOMBPATH="$(which tomb)" # Tomb executable's path
HEXENC="$KDFPATH/tomb-kdb-hexencode" HEXENC="$KDFPATH/tomb-kdb-hexencode"
@ -183,9 +183,8 @@ function _main {
"bury" "Hide a key inside a JPEG image" \ "bury" "Hide a key inside a JPEG image" \
"exhume" "Extract a key from a JPEG image"` "exhume" "Extract a key from a JPEG image"`
if [[ "$?" = 1 && $SWAPOFF = "true" ]]; then if [[ "$?" = 1 && $SWAPOFF = "true" ]]; then
SUDOPWD=$(zenity --password --title="sudo swapon -a") zenity --password --title="sudo swapon -a" | sudo swapon -a
echo "$SUDOPWD" | sudo swapon -a unset $?
unset $SUDOPWD
fi fi
eval "_$cmnd" eval "_$cmnd"
} }
@ -627,9 +626,8 @@ function _ { _clean } # I like cleaning :)
if [[ $SWAPOFF = "true" ]]; then if [[ $SWAPOFF = "true" ]]; then
FLAG="" FLAG=""
SUDOPWD=$(zenity --password --title="sudo swapoff -a") zenity --password --title="sudo swapoff -a" | sudo swapoff -a
echo "$SUDOPWD" | sudo swapoff -a unset $?
unset $SUDOPWD
else else
FLAG="-f" FLAG="-f"
fi fi