mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2026-02-01 03:09:02 +02:00
external uid is now correctly applied
This commit is contained in:
@@ -70,7 +70,8 @@ ENV DEBIAN_FRONTEND="teletype" \
|
||||
LC_ALL="de_DE.UTF-8" \
|
||||
TZ="Europe/Berlin" \
|
||||
PACKAGES="nano" \
|
||||
AVAHI="false"
|
||||
AVAHI="false" \
|
||||
HOSTUID=1000
|
||||
|
||||
# Setting up EXPOSE for Admin
|
||||
EXPOSE 8081/tcp
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
# Reading env-variables
|
||||
packages=$PACKAGES
|
||||
avahi=$AVAHI
|
||||
uid=$PUID
|
||||
gid=$PGID
|
||||
uid=$HOSTUID
|
||||
|
||||
# Getting date and time for logging
|
||||
dati=`date '+%Y-%m-%d %H:%M:%S'`
|
||||
@@ -14,7 +13,7 @@ echo ''
|
||||
echo '----------------------------------------'
|
||||
echo '----- Image-Version: 3.0.2beta -----'
|
||||
echo '----- '$dati' -----'
|
||||
echo '----- uid: '$uid' gid: '$gid' -----'
|
||||
echo '----- uid: '$uid' -----'
|
||||
echo '----------------------------------------'
|
||||
echo ''
|
||||
echo 'Startupscript running...'
|
||||
@@ -45,8 +44,24 @@ fi
|
||||
echo 'who am i'
|
||||
whoami
|
||||
|
||||
echo 'whats my id'
|
||||
id $(whoami)
|
||||
|
||||
# Checking for first run and change permissions
|
||||
if [ -f /opt/.firstrun ]
|
||||
then
|
||||
echo ''
|
||||
echo 'Changing permissions upon first run (This might take a while! Please be patient!)...'
|
||||
usermod -u $uid iobroker
|
||||
chown -R $uid /opt/iobroker
|
||||
chown -R $uid /opt/scripts
|
||||
rm -f /opt/.firstrun
|
||||
echo 'Changing permissions done...'
|
||||
fi
|
||||
|
||||
# Backing up original iobroker-file and changing sudo to gosu
|
||||
cp -a /opt/iobroker/iobroker /opt/iobroker/iobroker.bak
|
||||
chmod u+x /opt/iobroker/iobroker
|
||||
sed -i 's/sudo -H -u/gosu/g' /opt/iobroker/iobroker
|
||||
|
||||
# Checking for first run of a new installation and renaming ioBroker
|
||||
@@ -61,22 +76,12 @@ then
|
||||
echo 'Renaming ioBroker done...'
|
||||
fi
|
||||
|
||||
# Checking for first run and change permissions
|
||||
if [ -f /opt/.firstrun ]
|
||||
then
|
||||
echo ''
|
||||
echo 'Changing permissions upon first run (This might take a while! Please be patient!)...'
|
||||
chown -R $uid:$gid /opt/iobroker
|
||||
chown -R $uid:$gid /opt/scripts
|
||||
rm -f /opt/.firstrun
|
||||
echo 'Changing permissions done...'
|
||||
fi
|
||||
|
||||
# Checking for and setting up avahi-daemon
|
||||
if [ "$avahi" = "true" ]
|
||||
then
|
||||
echo ''
|
||||
echo 'Initializing Avahi-Daemon...'
|
||||
chmod u+x /opt/scripts/setup_avahi.sh
|
||||
sh /opt/scripts/setup_avahi.sh
|
||||
echo 'Initializing Avahi-Daemon done...'
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user