feat: auto create config folder and player network

This commit is contained in:
Justin Lin committed 2024-10-16 14:13:41 +08:00
1 parent 91ebaec22c
commit b449d84c54
5 files changed
+25 -2

No files matched your search

+4
View File
@@ -2,10 +2,14 @@
USERNAME=commander
echo "Initializing container for $USERNAME"
if ! id -u ${USERNAME} >/dev/null 2>&1; then
echo "Adding user $USERNAME"
adduser --disabled-password --gecos '' --shell /bin/zsh ${USERNAME} && \
find / -name ".gitkeep" -type f -exec rm -f {} +
echo "Adding public key for $USERNAME"
PUB_KEY=/etc/ssh/authorized_keys/${USERNAME}
cp /ssh_key.pub ${PUB_KEY}
chmod 644 ${PUB_KEY}