totally refactored

This commit is contained in:
Jun Kurihara 2022-07-09 01:01:00 +09:00
commit 907d7e574b
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
13 changed files with 372 additions and 252 deletions

View file

@ -1,4 +1,14 @@
#!/usr/bin/env bash
LOG_FILE=/var/log/rpxy/rpxy.log
/run.sh 2>&1 | tee $LOG_FILE
if [ -z ${LOG_TO_FILE} ]; then
LOG_TO_FILE=false
fi
if "${LOG_TO_FILE}"; then
echo "rpxy: Start with writing log file"
/run.sh 2>&1 | tee $LOG_FILE
else
echo "rpxy: Start without writing log file"
/run.sh 2>&1
fi

View file

@ -52,12 +52,9 @@ cp -p /etc/cron.daily/logrotate /etc/cron.hourly/
service cron start
# debug level logging
if [ -z $LOG_LEVEL ]; then
LOG_LEVEL=info
if [ ${DEBUG} ]; then
echo "Logging in debug mode"
LOG_LEVEL=debug
fi
echo "Start rpxy"
fi
echo "rpxy: Logging with level ${LOG_LEVEL}"
RUST_LOG=${LOG_LEVEL} /opt/rpxy/sbin/rpxy --config ${CONFIG_FILE}