script: use whiptail for check_euid

This commit is contained in:
Yifei Ding
2021-11-08 17:33:55 -08:00
parent c7ce5ad36c
commit 415d057efe
2 changed files with 4 additions and 7 deletions

View File

@@ -43,8 +43,8 @@ BRANCH_SCURVE_SMOOTHING=dmbutyugin/scurve-smoothing
BRANCH_SCURVE_SHAPING=dmbutyugin/scurve-shaping BRANCH_SCURVE_SHAPING=dmbutyugin/scurve-shaping
###Whiptail ###Whiptail
KIAUH_WHIPTAIL_WIDTH=64 KIAUH_WHIPTAIL_WIDTH=96
KIAUH_WHIPTAIL_HEIGHT=30 KIAUH_WHIPTAIL_HEIGHT=25
#functions.sh #functions.sh
### base variables ### base variables

View File

@@ -2,11 +2,8 @@
check_euid(){ check_euid(){
if [ "$EUID" -eq 0 ] if [ "$EUID" -eq 0 ]
then then
echo -e "${red}" whiptail --title "$KIAUH_TITLE" --msgbox "!!! THIS SCRIPT MUST NOT RAN AS ROOT !!!"\
top_border "$KIAUH_WHIPTAIL_HEIGHT" "$KIAUH_WHIPTAIL_WIDTH"
echo -e "| !!! THIS SCRIPT MUST NOT RAN AS ROOT !!! |"
bottom_border
echo -e "${default}"
exit 1 exit 1
fi fi
} }