From cb347e2124d251402775d03ac733a7fabd832c62 Mon Sep 17 00:00:00 2001 From: uselibrary Date: Fri, 24 Jun 2022 18:59:43 +0800 Subject: [PATCH] update authorization --- scripts/update.sh | 9 +++++++-- scripts/update_cn.sh | 9 +++++++-- scripts/update_dev.sh | 9 +++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/scripts/update.sh b/scripts/update.sh index 8df4e7b61..162d867cf 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -9,13 +9,18 @@ startTime=`date +%s` _os=`uname` echo "use system: ${_os}" +if [ "$EUID" -ne 0 ] + then echo "Please run as root!" + exit +fi + if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then - sudo ln -sf /bin/bash /bin/sh + ln -sf /bin/bash /bin/sh #sudo dpkg-reconfigure dash fi if grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then - sudo ln -sf /bin/bash /bin/sh + ln -sf /bin/bash /bin/sh fi if [ ${_os} == "Darwin" ]; then diff --git a/scripts/update_cn.sh b/scripts/update_cn.sh index a5353fb1b..7e1799d5b 100755 --- a/scripts/update_cn.sh +++ b/scripts/update_cn.sh @@ -9,13 +9,18 @@ startTime=`date +%s` _os=`uname` echo "use system: ${_os}" +if [ "$EUID" -ne 0 ] + then echo "Please run as root!" + exit +fi + if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then - sudo ln -sf /bin/bash /bin/sh + ln -sf /bin/bash /bin/sh #sudo dpkg-reconfigure dash fi if grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then - sudo ln -sf /bin/bash /bin/sh + ln -sf /bin/bash /bin/sh fi if [ ${_os} == "Darwin" ]; then diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index c3942ae88..e3866e542 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -9,13 +9,18 @@ startTime=`date +%s` _os=`uname` echo "use system: ${_os}" +if [ "$EUID" -ne 0 ] + then echo "Please run as root!" + exit +fi + if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then - sudo ln -sf /bin/bash /bin/sh + ln -sf /bin/bash /bin/sh #sudo dpkg-reconfigure dash fi if grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then - sudo ln -sf /bin/bash /bin/sh + ln -sf /bin/bash /bin/sh fi if [ ${_os} == "Darwin" ]; then