run_as_user
This commit is contained in:
parent
57e7622081
commit
fc506c1dd3
4 changed files with 8 additions and 4 deletions
|
@ -4,7 +4,8 @@ set -ex
|
||||||
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
echo "This script must be run as root" 1>&2
|
echo "This script must be run as root" 1>&2
|
||||||
exit 1
|
sudo $0
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||||
|
|
|
@ -7,7 +7,8 @@ set -ex
|
||||||
|
|
||||||
if [[ "$EUID" -ne 0 ]]; then
|
if [[ "$EUID" -ne 0 ]]; then
|
||||||
echo "Sorry, you need to run this as root"
|
echo "Sorry, you need to run this as root"
|
||||||
exit 1
|
sudo $0
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -e /dev/net/tun ]]; then
|
if [[ ! -e /dev/net/tun ]]; then
|
||||||
|
|
|
@ -4,7 +4,8 @@ set -xe
|
||||||
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
echo "This script must be run as root" 1>&2
|
echo "This script must be run as root" 1>&2
|
||||||
exit 1
|
sudo $0
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
apt update
|
apt update
|
||||||
|
|
|
@ -5,7 +5,8 @@ set -ex
|
||||||
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
echo "This script must be run as root" 1>&2
|
echo "This script must be run as root" 1>&2
|
||||||
exit 1
|
sudo $0
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "change" == "$1" ]; then
|
if [ "change" == "$1" ]; then
|
||||||
|
|
Loading…
Reference in a new issue