Add root checks and given an appropriate message if not running as root
This commit is contained in:
parent
28780b0f25
commit
71758ecf29
@ -2,6 +2,11 @@
|
||||
# script that runs
|
||||
# https://kubernetes.io/docs/setup/production-environment/container-runtime
|
||||
|
||||
if [ $(id -u) != 0 ]; then
|
||||
echo "Please run as root or use sudo."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
yum install -y vim yum-utils device-mapper-persistent-data lvm2
|
||||
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
||||
|
||||
|
||||
@ -2,6 +2,11 @@
|
||||
# kubeadm installation instructions as on
|
||||
# https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/
|
||||
|
||||
if [ $(id -u) != 0 ]; then
|
||||
echo "Please run as root or use sudo."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
|
||||
[kubernetes]
|
||||
name=Kubernetes
|
||||
|
||||
Loading…
Reference in New Issue
Block a user