[PATCH] live-image: ask for sudo permissions instead of exiting
Alex Hung
alex.hung at canonical.com
Wed Jun 17 23:43:44 UTC 2020
Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
live-image/fwts-frontend-text | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/live-image/fwts-frontend-text b/live-image/fwts-frontend-text
index 7fe4533f..4c397438 100755
--- a/live-image/fwts-frontend-text
+++ b/live-image/fwts-frontend-text
@@ -31,7 +31,8 @@ FWTS_TIME=`date +%H%M`
#
if [ $EUID -ne 0 ]; then
echo "`basename $0`: must be executed with sudo"
- exit 1
+ SELF="$(readlink -f "${BASH_SOURCE[0]}")"
+ exec sudo -- "$BASH" -- "$SELF" "$@"
fi
#
--
2.25.1
More information about the fwts-devel
mailing list