Some radius fixes

This commit is contained in:
kjeld Schouten-Lebbing
2021-09-01 13:36:10 +02:00
parent 67503ec988
commit a09829bac9
5 changed files with 14 additions and 11 deletions
+1 -2
View File
@@ -4,14 +4,13 @@ ARG VERSION
FROM freeradius/freeradius-server:${VERSION}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
VOLUME /config
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
RUN \
rm /docker-entrypoint.sh && \
rm -Rf /etc/raddb
VOLUME /etc/raddb
COPY ./containers/apps/freeradius/entrypoint.sh /docker-entrypoint.sh
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
+6 -6
View File
@@ -1,32 +1,32 @@
#!/bin/sh
set -e
if [ -f "/config/clients.conf" ]; then
if [ -f "/etc/raddb/clients.conf" ]; then
echo "Radius config already exists, skipping config copy..."
else
echo "Radius config does not exist, copying..."
cp -Rf /etc/freeradius/* /config/
cp -Rf /etc/freeradius/* /etc/raddb/
fi
chown -R freerad:freerad /config
chown -R freerad:freerad /etc/raddb/
# this if will check if the first argument is a flag
# but only works if all arguments require a hyphenated flag
# -v; -SL; -f arg; etc will work, but not arg1 arg2
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
set -- freeradius -d /config "$@"
set -- freeradius "$@"
fi
# check for the expected command
if [ "$1" = 'freeradius' ]; then
shift
exec freeradius -f -d /config "$@"
exec freeradius -f "$@"
fi
# many people are likely to call "radiusd" as well, so allow that
if [ "$1" = 'radiusd' ]; then
shift
exec freeradius -f -d /config "$@"
exec freeradius -f "$@"
fi
# else default to run whatever the user wanted like "bash" or "sh"