让 run.sh 能用 sh 跑
This commit is contained in:
parent
4805b9049e
commit
6d753b35f1
6
run.sh
6
run.sh
@ -1,13 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
scriptdir=$(dirname $(realpath $0))
|
scriptdir=$(dirname $(realpath $0))
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
|
|
||||||
if [[ $EUID -eq 0 ]]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
echo "Running in root mode."
|
echo "Running in root mode."
|
||||||
$scriptdir/init_root.sh
|
$scriptdir/init_root.sh
|
||||||
elif [[ $(sudo whoami) == "root" ]]; then
|
elif [ "$(sudo id -u)" -eq 0 ]; then
|
||||||
echo "Running in sudo mode."
|
echo "Running in sudo mode."
|
||||||
$scriptdir/init_sudo.sh
|
$scriptdir/init_sudo.sh
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user