2019-06-24 18:03:06 +00:00
|
|
|
#!/usr/bin/with-contenv bash
|
|
|
|
|
2019-06-24 19:15:27 +00:00
|
|
|
mkdir -p /config/{extensions,data,workspace,.ssh}
|
2019-06-24 18:03:06 +00:00
|
|
|
|
2019-07-09 21:43:45 +00:00
|
|
|
if [ -n "${SUDO_PASSWORD}" ]; then
|
2019-07-09 21:29:50 +00:00
|
|
|
echo "setting up sudo access"
|
2019-07-09 22:55:11 +00:00
|
|
|
if ! grep -q 'abc' /etc/sudoers; then
|
2019-07-09 21:29:50 +00:00
|
|
|
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 18:03:06 +00:00
|
|
|
# permissions
|
|
|
|
chown -R abc:abc \
|
|
|
|
/config
|