mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2026-03-28 06:56:34 +00:00
Add local PAM docker-compose
This commit is contained in:
@@ -1,11 +1,34 @@
|
||||
#!/bin/sh
|
||||
cd /opt/rdpgw || exit 1
|
||||
|
||||
if ! [ -e /opt/rdpgw/rdpgw.yaml ]; then
|
||||
cp /opt/rdpgw/rdpgw.yaml.default /opt/rdpgw/rdpgw.yaml
|
||||
USER=rdpgw
|
||||
|
||||
file="/root/createusers.txt"
|
||||
if [ -f $file ]
|
||||
then
|
||||
while IFS=: read -r username password is_sudo
|
||||
do
|
||||
echo "Username: $username, Password: **** , Sudo: $is_sudo"
|
||||
|
||||
if getent passwd "$username" > /dev/null 2>&1
|
||||
then
|
||||
echo "User Exists"
|
||||
else
|
||||
adduser -s /sbin/nologin "$username"
|
||||
echo "$username:$password" | chpasswd
|
||||
fi
|
||||
done <"$file"
|
||||
fi
|
||||
|
||||
/opt/rdpgw/rdpgw-auth &
|
||||
/opt/rdpgw/rdpgw &
|
||||
cd /opt/rdpgw || exit 1
|
||||
|
||||
if [ -n "${RDPGW_SERVER__AUTHENTICATION}" ]; then
|
||||
if [ "${RDPGW_SERVER__AUTHENTICATION}" = "local" ]; then
|
||||
echo "Starting rdpgw-auth"
|
||||
/opt/rdpgw/rdpgw-auth &
|
||||
fi
|
||||
fi
|
||||
|
||||
# drop privileges and run the application
|
||||
su -c /opt/rdpgw/rdpgw ${USER} &
|
||||
wait
|
||||
exit $?
|
||||
|
||||
Reference in New Issue
Block a user