mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-23 11:31:49 +01:00
16a78e70ce
This serves to do two things: 1) chown /znc to znc:znc, which is really handy if the znc user inside the docker container has a new uid, because the files are stored on the host filesystem. 2) to drop privs to the znc user, to reduce the attack surface.
12 lines
168 B
Bash
Executable File
12 lines
168 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
ZNC_DIR="/znc"
|
|
ZNC_OWNER=$(stat -c "%U" ${ZNC_DIR})
|
|
|
|
if [ "${ZNC_OWNER}" != "znc" ]; then
|
|
chown -R znc:znc ${ZNC_DIR}
|
|
fi
|
|
|
|
exec sudo -u znc "$@"
|