From 415d057efe21c4de4e23c3114684195ae54d8944 Mon Sep 17 00:00:00 2001 From: Yifei Ding Date: Mon, 8 Nov 2021 17:33:55 -0800 Subject: [PATCH] script: use whiptail for check_euid --- scripts/constants/constants.sh | 4 ++-- scripts/functions.sh | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/constants/constants.sh b/scripts/constants/constants.sh index 68c44ed..b491a28 100755 --- a/scripts/constants/constants.sh +++ b/scripts/constants/constants.sh @@ -43,8 +43,8 @@ BRANCH_SCURVE_SMOOTHING=dmbutyugin/scurve-smoothing BRANCH_SCURVE_SHAPING=dmbutyugin/scurve-shaping ###Whiptail -KIAUH_WHIPTAIL_WIDTH=64 -KIAUH_WHIPTAIL_HEIGHT=30 +KIAUH_WHIPTAIL_WIDTH=96 +KIAUH_WHIPTAIL_HEIGHT=25 #functions.sh ### base variables diff --git a/scripts/functions.sh b/scripts/functions.sh index a9535c1..7697a34 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -2,11 +2,8 @@ check_euid(){ if [ "$EUID" -eq 0 ] then - echo -e "${red}" - top_border - echo -e "| !!! THIS SCRIPT MUST NOT RAN AS ROOT !!! |" - bottom_border - echo -e "${default}" + whiptail --title "$KIAUH_TITLE" --msgbox "!!! THIS SCRIPT MUST NOT RAN AS ROOT !!!"\ + "$KIAUH_WHIPTAIL_HEIGHT" "$KIAUH_WHIPTAIL_WIDTH" exit 1 fi }