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