ls-code-server/root/etc/cont-init.d/30-config
2019-07-09 18:32:57 -04:00

18 lines
419 B
Plaintext

#!/usr/bin/with-contenv bash
mkdir -p /config/{extensions,data,workspace,.ssh}
if [ -n "${SUDO_PASSWORD}" ]; then
echo "setting up sudo access"
if [ ! $(grep -c 'abc' /etc/sudoers) ]; 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
# permissions
chown -R abc:abc \
/config