Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
19 lines
613 B
Bash
19 lines
613 B
Bash
#!/bin/bash
|
|
set -ex
|
|
|
|
wait-for-it db:3306 -t 300 -- echo "database is connected"
|
|
if [[ ! $(mysql --host=db --user=root --password=root cacti -e "show tables") =~ "automation_devices" ]]; then
|
|
mysql --host=db --user=root --password=root cacti < /var/www/html/cacti.sql
|
|
mysql --host=db --user=root --password=root cacti -e "UPDATE user_auth SET must_change_password='' WHERE username = 'admin'"
|
|
mysql --host=db --user=root --password=root cacti -e "SET GLOBAL time_zone = 'UTC'"
|
|
fi
|
|
|
|
cron
|
|
|
|
# first arg is `-f` or `--some-option`
|
|
if [ "${1#-}" != "$1" ]; then
|
|
set -- apache2-foreground "$@"
|
|
fi
|
|
|
|
exec "$@"
|