Skip to content

Commit

Permalink
feat: 🎸 回滚表更
Browse files Browse the repository at this point in the history
  • Loading branch information
danni-cool committed Jun 29, 2024
1 parent 4382503 commit 064481d
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 deletions linux/sh/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,22 @@ function check_vnc_pass {
export X11_ARGS=""
fi
}
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
# Generate ssh key
ssh-keygen -N '' -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -N '' -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -N '' -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
fi

# 切换回 root 用户来执行特权命令
if [ "$(id -u)" -eq 0 ]; then
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
# Generate ssh key
ssh-keygen -N '' -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -N '' -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -N '' -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
fi

check_vnc_pass

if [[ -n $USER_PASSWORD ]]; then
echo "docker:$USER_PASSWORD" | chpasswd
fi
if [[ -n $PUID ]]; then
usermod -u "$PUID" docker
fi
if [[ -n $PGID ]]; then
groupmod -g "$PGID" docker
fi
check_vnc_pass

# 切换到 docker 用户
exec su docker -c "/etc/entrypoint.sh"
if [[ -n $USER_PASSWORD ]];then
echo "docker:$USER_PASSWORD" | chpasswd
fi
if [[ -n $PUID ]]; then
usermod -u "$PUID" docker
fi
if [[ -n $PGID ]]; then
groupmod -g "$PGID" docker
fi

/usr/bin/supervisord

0 comments on commit 064481d

Please sign in to comment.