Skip to content

Commit

Permalink
bug: reset only if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mhzawadi committed Sep 12, 2024
1 parent 84239c6 commit 36219d1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions setup/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ then
cp /var/www/html/ipconfig.php.example /var/www/html/ipconfig.php
fi

[ -n "$IP_URL" ] && sed -i -e "s!IP_URL=!IP_URL=${IP_URL}!" /var/www/html/ipconfig.php
[ -n "$IP_URL" ] && sed -i -e "s!IP_URL=\$!IP_URL=${IP_URL}!" /var/www/html/ipconfig.php
[ -n "$ENABLE_DEBUG" ] && sed -i -e "s/ENABLE_DEBUG=.*/ENABLE_DEBUG=${ENABLE_DEBUG}/" /var/www/html/ipconfig.php
[ -n "$DISABLE_SETUP" ] && sed -i -e "s/DISABLE_SETUP=.*/DISABLE_SETUP=${DISABLE_SETUP}/" /var/www/html/ipconfig.php
[ -n "$REMOVE_INDEXPHP" ] && sed -i -e "s/REMOVE_INDEXPHP=.*/REMOVE_INDEXPHP=${REMOVE_INDEXPHP}/" /var/www/html/ipconfig.php

[ -n "$MYSQL_HOST" ] && sed -i -e "s/DB_HOSTNAME=/DB_HOSTNAME=${MYSQL_HOST}/" /var/www/html/ipconfig.php
[ -n "$MYSQL_USER" ] && sed -i -e "s/DB_USERNAME=/DB_USERNAME=${MYSQL_USER}/" /var/www/html/ipconfig.php
[ -n "$MYSQL_PASSWORD" ] && sed -i -e "s/DB_PASSWORD=/DB_PASSWORD=${MYSQL_PASSWORD}/" /var/www/html/ipconfig.php
[ -n "$MYSQL_DB" ] && sed -i -e "s/DB_DATABASE=/DB_DATABASE=${MYSQL_DB}/" /var/www/html/ipconfig.php
[ -n "$MYSQL_PORT" ] && sed -i -e "s/DB_PORT=/DB_PORT=${MYSQL_PORT}/" /var/www/html/ipconfig.php
[ -n "$MYSQL_HOST" ] && sed -i -e "s/^DB_HOSTNAME=$/DB_HOSTNAME=${MYSQL_HOST}/" /var/www/html/ipconfig.php
[ -n "$MYSQL_USER" ] && sed -i -e "s/^DB_USERNAME=$/DB_USERNAME=${MYSQL_USER}/" /var/www/html/ipconfig.php
[ -n "$MYSQL_PASSWORD" ] && sed -i -e "s/^DB_PASSWORD=$/DB_PASSWORD=${MYSQL_PASSWORD}/" /var/www/html/ipconfig.php
[ -n "$MYSQL_DB" ] && sed -i -e "s/^DB_DATABASE=$/DB_DATABASE=${MYSQL_DB}/" /var/www/html/ipconfig.php
[ -n "$MYSQL_PORT" ] && sed -i -e "s/^DB_PORT=$/DB_PORT=${MYSQL_PORT}/" /var/www/html/ipconfig.php

[ -n "$SESS_EXPIRATION" ] && sed -i -e "s/SESS_EXPIRATION=/SESS_EXPIRATION=${SESS_EXPIRATION}/" /var/www/html/ipconfig.php
[ -n "$SESS_MATCH_IP" ] && sed -i -e "s/SESS_MATCH_IP=/SESS_MATCH_IP=${SESS_MATCH_IP}/" /var/www/html/ipconfig.php
[ -n "$ENABLE_INVOICE_DELETION" ] && sed -i -e "s/ENABLE_INVOICE_DELETION=/ENABLE_INVOICE_DELETION=${ENABLE_INVOICE_DELETION}/" /var/www/html/ipconfig.php
[ -n "$DISABLE_READ_ONLY" ] && sed -i -e "s/DISABLE_READ_ONLY=/DISABLE_READ_ONLY=${DISABLE_READ_ONLY}/" /var/www/html/ipconfig.php
[ -n "$SESS_EXPIRATION" ] && sed -i -e "s/^SESS_EXPIRATION=$/SESS_EXPIRATION=${SESS_EXPIRATION}/" /var/www/html/ipconfig.php
[ -n "$SESS_MATCH_IP" ] && sed -i -e "s/^SESS_MATCH_IP=$/SESS_MATCH_IP=${SESS_MATCH_IP}/" /var/www/html/ipconfig.php
[ -n "$ENABLE_INVOICE_DELETION" ] && sed -i -e "s/^ENABLE_INVOICE_DELETION=$/ENABLE_INVOICE_DELETION=${ENABLE_INVOICE_DELETION}/" /var/www/html/ipconfig.php
[ -n "$DISABLE_READ_ONLY" ] && sed -i -e "s/^DISABLE_READ_ONLY=$/DISABLE_READ_ONLY=${DISABLE_READ_ONLY}/" /var/www/html/ipconfig.php

### CRITICAL
if [ -n "$SETUP_COMPLETED" ]; then
Expand Down

0 comments on commit 36219d1

Please sign in to comment.