2023-08-25 10:29:22 -06:00
|
|
|
#!/bin/bash
|
2023-08-25 12:20:22 -06:00
|
|
|
if [[ -z "${HOME_USER}" ]]; then
|
|
|
|
HOME_USER="vscode"
|
|
|
|
fi
|
|
|
|
|
2023-08-25 19:20:38 -06:00
|
|
|
addgroup nonroot
|
2023-08-25 12:20:22 -06:00
|
|
|
adduser --disabled-password --gecos "" ${HOME_USER}
|
|
|
|
echo "${HOME_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
2023-08-25 19:20:38 -06:00
|
|
|
|
2023-08-25 12:20:22 -06:00
|
|
|
if [[ -z "${VSCODE_TUNNEL_NAME}" ]]; then
|
2023-08-26 21:50:03 -06:00
|
|
|
sudo su - ${HOME_USER} -c code tunnel --accept-server-license-terms
|
2023-08-25 12:20:22 -06:00
|
|
|
else
|
2023-08-26 21:50:03 -06:00
|
|
|
sudo su - ${HOME_USER} -c code tunnel --accept-server-license-terms --name ${VSCODE_TUNNEL_NAME}
|
2023-08-25 12:20:22 -06:00
|
|
|
fi
|