mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
Update entrypoint.sh
This commit is contained in:
parent
e3e1e17859
commit
e071582455
@ -1,16 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo "Container is starting..."
|
echo "Container is starting..."
|
||||||
|
|
||||||
# Get the current container's IP address
|
: '
|
||||||
|
CONFIGURATION
|
||||||
|
On restart grant sudo if set, store random ip
|
||||||
|
'
|
||||||
CONTAINER_IP=$(hostname -i)
|
CONTAINER_IP=$(hostname -i)
|
||||||
|
|
||||||
# Old IP address to be replaced on docker run
|
|
||||||
OLD_IP="tst"
|
OLD_IP="tst"
|
||||||
|
SUDO="NO"
|
||||||
|
|
||||||
|
|
||||||
# Configuration files and directories
|
# Configuration files and directories
|
||||||
memcached_dir="/var/run/memcached/"
|
memcached_dir="/var/run/memcached/"
|
||||||
apache_default_site="/etc/apache2/sites-available/000-default.conf"
|
apache_default_site="/etc/apache2/sites-available/000-default.conf"
|
||||||
service cron start
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -127,6 +129,11 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# sudo
|
||||||
|
if grep -q 'SUDO="YES"' /etc/entrypoint.sh; then
|
||||||
|
# Add user with UID 1000 to the sudo group
|
||||||
|
usermod -aG sudo -u 1000 $(getent passwd 1000 | cut -d: -f1)
|
||||||
|
fi
|
||||||
|
|
||||||
# Save the current IP for reuse
|
# Save the current IP for reuse
|
||||||
sed -i "s/$OLD_IP/$CONTAINER_IP/g" "$0"
|
sed -i "s/$OLD_IP/$CONTAINER_IP/g" "$0"
|
||||||
|
Loading…
Reference in New Issue
Block a user