Rewrite to not need bash

This commit is contained in:
2024-01-23 13:11:56 -06:00
parent a710a0c966
commit 3c29d6d460
6 changed files with 15 additions and 15 deletions

View File

@@ -1,14 +1,14 @@
#!/command/with-contenv bash
#!/command/with-contenv sh
source ContainerTools
SNAME=${BASH_SOURCE##*/}
SNAME=${0##*/}
WORKDIR="/var/www/pterodactyl"
#
# If DBHOST value is present, pause boot until target container is up.
if [ -n "$DBHOST" ]; then
log "Waiting for SQL at $DBHOST:${DBPORT:=3306}"
if wait-for-it $DBHOST:$DBPORT -q -t ${TESTTIME:=30}; then
log "SQL found, continuing"
if wait-for-it $DBHOST:$DBPORT -q -t ${TESTTIME:=30}; then
log "SQL found, continuing"
else
log "SQL could not be reached! Exiting..."
exit 1
@@ -18,8 +18,8 @@ fi
# If REDISHOST value is present, pause boot until target container is up.
if [ -n "$REDISHOST" ]; then
log "Waiting for Redis at $REDISHOST:${REDISPORT:=6379}"
if wait-for-it $REDISHOST:$REDISPORT -q -t ${TESTTIME:=30}; then
log "Redis found, continuing"
if wait-for-it $REDISHOST:$REDISPORT -q -t ${TESTTIME:=30}; then
log "Redis found, continuing"
else
log "Redis could not be reached! Exiting..."
exit 1
@@ -69,4 +69,4 @@ else
ln -s /defaults/nginx/http.conf /etc/nginx/http.d/pterodactyl.conf
fi
fi
log "Initialization complete"
log "Initialization complete"