Spaces:
Sleeping
Sleeping
set -e | |
log() { | |
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | |
} | |
update_config() { | |
log "Updating configuration..." | |
sed -i "s/ENV_Alist_DB_TYPE/${Alist_DB_TYPE:-mysql}/g" data/config.json | |
log "Updated DB_TYPE to ${Alist_DB_TYPE:-mysql}" | |
sed -i "s/ENV_Alist_DB_HOST/${Alist_DB_HOST:-localhost}/g" data/config.json | |
sed -i "s/ENV_Alist_DB_PORT/${Alist_DB_PORT:-3306}/g" data/config.json | |
sed -i "s/ENV_Alist_DB_USER/${Alist_DB_USER:-root}/g" data/config.json | |
sed -i "s/ENV_Alist_DB_PASSWORD/${Alist_DB_PASSWORD:-password}/g" data/config.json | |
sed -i "s/ENV_Alist_DB_NAME/${Alist_DB_NAME:-alist}/g" data/config.json | |
log "Updated DB_NAME to ${Alist_DB_NAME:-alist}" | |
} | |
log "Starting script..." | |
update_config | |
log "Starting aria2c..." | |
aria2c --conf-path=aria2.conf & | |
log "Starting alist server..." | |
./alist server |