From 6d753b35f1426ab8d193c3957927e932b6c500f5 Mon Sep 17 00:00:00 2001 From: Konano Date: Sun, 23 Jul 2023 02:20:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A9=20run.sh=20=E8=83=BD=E7=94=A8=20sh=20?= =?UTF-8?q?=E8=B7=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run.sh b/run.sh index 19bb198..437c397 100755 --- a/run.sh +++ b/run.sh @@ -1,13 +1,13 @@ -#!/bin/bash +#!/bin/sh scriptdir=$(dirname $(realpath $0)) # ============================================================ -if [[ $EUID -eq 0 ]]; then +if [ "$(id -u)" -eq 0 ]; then echo "Running in root mode." $scriptdir/init_root.sh -elif [[ $(sudo whoami) == "root" ]]; then +elif [ "$(sudo id -u)" -eq 0 ]; then echo "Running in sudo mode." $scriptdir/init_sudo.sh else