minor
This commit is contained in:
parent
52b5fc4aba
commit
cc44fe9fa9
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
scriptdir=$(dirname $(realpath $0))
|
||||
tempdir="/tmp"
|
||||
tempdir=$(mktemp -d)
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "This script must be run as root."
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
scriptdir=$(dirname $(realpath $0))
|
||||
tempdir="/tmp"
|
||||
tempdir=$(mktemp -d)
|
||||
|
||||
if [[ $EUID -eq 0 ]]; then
|
||||
echo "This script should not be run as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! sudo -v; then
|
||||
if [[ $(sudo whoami) != "root" ]]; then
|
||||
echo "Please get sudo access first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
3
run.sh
3
run.sh
@ -1,14 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
scriptdir=$(dirname $(realpath $0))
|
||||
tempdir="/tmp"
|
||||
|
||||
# ============================================================
|
||||
|
||||
if [[ $EUID -eq 0 ]]; then
|
||||
echo "Running in root mode."
|
||||
sh $scriptdir/init_root.sh
|
||||
elif sudo -v; then
|
||||
elif [[ $(sudo whoami) == "root" ]]; then
|
||||
echo "Running in sudo mode."
|
||||
sh $scriptdir/init_sudo.sh
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user