mirror of
https://github.com/cusspvz/openwrt-builder.docker.git
synced 2026-08-20 04:42:55 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
chown -R $GOSU_USER /lede
|
||||
|
||||
# If GOSU_USER environment variable set to something other than 0:0 (root:root),
|
||||
# become user:group set within and exec command passed in args
|
||||
if [ "$GOSU_USER" != "0:0" ]; then
|
||||
# make sure a valid user exists in /etc/passwd
|
||||
if grep "^builder:" /etc/passwd; then
|
||||
sed -i "/^builder:/d" /etc/passwd
|
||||
fi
|
||||
echo "builder:x:$GOSU_USER:LEDE builder:/lede:/bin/bash" >> /etc/passwd
|
||||
exec gosu $GOSU_USER "$@"
|
||||
fi
|
||||
|
||||
# If GOSU_USER was 0:0 exec command passed in args without gosu (assume already root)
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user