| 1 | |
| 2 | |
| 3 | case "$1" in |
| 4 | "ubuntu") docker run --rm -v "$(pwd):/installer" -w /installer -it ubuntu bash -c " |
| 5 | apt update -y && apt install sudo -y && useradd test -m && echo test:test | chpasswd && usermod -aG sudo test && |
| 6 | ln -s /installer/install.sh /bin/doit && su - test" ;; |
| 7 | "arch") docker run --rm -v "$(pwd):/installer" -w /installer -it archlinux bash -c " |
| 8 | pacman --noconfirm -Syu && pacman -S sudo --noconfirm && useradd test -m && usermod -aG wheel test && |
| 9 | echo test:test | chpasswd && sed -i 's/# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers && |
| 10 | ln -s /installer/install.sh /bin/doit && su - test" ;; |
| 11 | *) echo "usage: install_test.sh [ubuntu|arch]" |
| 12 | esac |