Files
clr-installer/scripts/gce-image-google-sudoers-setup.sh
T
Leandro Dorileo 71305a8326 images: add image descriptors
aws, azure, ciao-networking, cloud, containers, gce, and hyperv
image descriptors.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-26 16:03:11 -07:00

29 lines
460 B
Bash
Executable File

#!/bin/bash
# This script creates the sudoers elements that
# GCE expects in the image to add user to google-sudoers
# whe a user key is injected
usage() {
echo "Provide path to existing chroot"
exit 1
}
main() {
local CHROOTPATH=$1
sudo touch ${CHROOTPATH}/etc/sudoers
sudo chmod 440 ${CHROOTPATH}/etc/sudoers
sudo mkdir ${CHROOTPATH}/etc/sudoers.d
}
if [ $# -eq 0 ]; then
usage
fi
if [ ! -d "$1" ]; then
usage
fi
main $@