From cd61ed525548bf9f75fcd36b083b32f9b12b987c Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Sun, 23 Dec 2018 14:47:29 +0400 Subject: [PATCH] Root privileges are now optional --- init-letsencrypt.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init-letsencrypt.sh b/init-letsencrypt.sh index 6cbb67f..106aaf6 100644 --- a/init-letsencrypt.sh +++ b/init-letsencrypt.sh @@ -7,7 +7,12 @@ email="" # Adding a valid address is strongly recommended staging=0 # Set to 1 if you're testing your setup to avoid hitting request limits if [ "$EUID" -ne 0 ]; then - echo "Please run init-letsencrypt.sh as root." && exit + read -p "You executed this script without root privileges, do you want to continue? (WARNING: script won't be able to delete generated Let's Encrypt TLS certificates) (Y/n) " decision + case $decision in + [Y]* ) ;; + [n]* ) exit;; + * ) echo "Please choose the right variant (Y/n).";; + esac fi