summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Barrett <spalf0@gmail.com>2019-12-13 04:21:46 -0600
committerTom Barrett <spalf0@gmail.com>2019-12-13 04:21:46 -0600
commite6ade29e5762862955077457c0061d5e769eca1d (patch)
tree7ad8192ab06f64328e185c8ccf41df4bc78a613c
parent2d2bcd64f8ed58d869b30c45171d18e5bdc84cdd (diff)
arch builds without input now
-rwxr-xr-xlxc/roll34
-rwxr-xr-xrequired2
2 files changed, 26 insertions, 10 deletions
diff --git a/lxc/roll b/lxc/roll
index f2e6cf5..6c8b9ef 100755
--- a/lxc/roll
+++ b/lxc/roll
@@ -2,23 +2,37 @@
#set -e
NAME=$1
+USER=tom
+PASS=durr
+
+# init
lxc-create -n $NAME -t download -- --dist archlinux --release current --arch amd64
lxc-start -n $NAME
sleep 10
+
+# install basics
lxc-attach -n $NAME -- pacman -Syu --noconfirm
lxc-attach -n $NAME -- pacman -Sy --noconfirm \
- go git sudo fakeroot binutils make gcc patch vim openssh xorg-xauth xorg-xhost
-lxc-attach -n $NAME -- useradd tom
-lxc-attach -n $NAME -- mkdir /home/tom
-lxc-attach -n $NAME -- mkdir /home/tom/yay
-lxc-attach -n $NAME -- git clone https://aur.archlinux.org/yay.git /home/tom/yay
-lxc-attach -n $NAME -- chown tom:tom -R /home/tom
-lxc-attach -n $NAME -- bash -c 'echo "tom ALL=(ALL) ALL" >> /etc/sudoers'
-lxc-attach -n $NAME -- bash -c 'echo -e "tom\ntom" | passwd tom'
-lxc-attach -n $NAME -- bash -c 'cd /home/tom/yay && sudo -S -u tom makepkg -si --noconfirm'
-lxc-attach -n $NAME -- bash -c 'sudo -S -u tom yay -Syu --noconfirm'
+ git sudo vim openssh xorg-xauth xorg-xhost fakeroot binutils
+
+# setup user
+lxc-attach -n $NAME -- useradd $USER
+lxc-attach -n $NAME -- mkdir /home/$USER
+lxc-attach -n $NAME -- bash -c 'echo "'$USER' ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers'
+lxc-attach -n $NAME -- bash -c 'echo -e "'$PASS'\n'$PASS'" | passwd '$USER
+
+# setup for yay
+lxc-attach -n $NAME -- mkdir /home/$USER/yay
+lxc-attach -n $NAME -- chown $USER:$USER -R /home/$USER
+lxc-attach -n $NAME -- git clone https://aur.archlinux.org/yay-bin.git /home/$USER/yay
+lxc-attach -n $NAME -- bash -c 'cd /home/'$USER'/yay && sudo -u '$USER' makepkg -si --noconfirm'
+lxc-attach -n $NAME -- bash -c 'sudo -u '$USER' yay -Syu --noconfirm'
+
+# setup x11 forwarding
lxc-attach -n $NAME -- bash -c 'echo "X11Forwarding yes" >> /etc/ssh/sshd_config'
lxc-attach -n $NAME -- bash -c 'echo "AllowTcpForwarding yes" >> /etc/ssh/sshd_config'
lxc-attach -n $NAME -- bash -c 'echo "X11UseLocalhost yes" >> /etc/ssh/sshd_config'
lxc-attach -n $NAME -- systemctl start sshd
+
+# display info
lxc-attach -n $NAME -- ip a
diff --git a/required b/required
index f2f6f85..825a6d8 100755
--- a/required
+++ b/required
@@ -25,6 +25,8 @@ apt install -y \
# web
apt install -y \
w3m \
+ w3m-img \
+ nmap \
curl \
netcat \
firefox-esr