ls-code-server/root/etc/cont-init.d/30-config

18 lines
418 B
Plaintext
Raw Normal View History

2019-06-24 20:03:06 +02:00
#!/usr/bin/with-contenv bash
2019-06-24 21:15:27 +02:00
mkdir -p /config/{extensions,data,workspace,.ssh}
2019-06-24 20:03:06 +02:00
if [ -n ${SUDO_PASSWORD} ]; then
echo "setting up sudo access"
if [ ! $(cat /etc/sudoers | grep abc) ]; then
echo "adding abc to sudoers"
echo "abc ALL=(ALL:ALL) ALL" >> /etc/sudoers
fi
echo "setting sudo password"
echo -e "${SUDO_PASSWORD}\n${SUDO_PASSWORD}" | passwd abc
fi
2019-06-24 20:03:06 +02:00
# permissions
chown -R abc:abc \
/config