mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-03-13 00:50:01 +00:00
Update zoneminder-install.sh
Fix mysql crash
This commit is contained in:
parent
445baab1ef
commit
3b4b895361
@ -26,25 +26,30 @@ $STD apt-get install -y \
|
|||||||
libapache2-mod-php
|
libapache2-mod-php
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
# Install / set up MySQL
|
# create a random password for root
|
||||||
msg_info "Install / set up MySQL"
|
# create a random password for the 'zmuser'
|
||||||
APPLICATION="ZoneMinder"
|
msg_info "Pre-seeding dbconfig-common for ZoneMinder"
|
||||||
APP_NAME="ZoneMinder"
|
|
||||||
DB_NAME="zm"
|
|
||||||
DB_USER="zmuser"
|
|
||||||
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
|
||||||
|
|
||||||
$STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
ROOT_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||||
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
|
ZMPASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||||
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
echo "zoneminder zoneminder/dbconfig-install boolean true" | debconf-set-selections
|
||||||
|
echo "zoneminder zoneminder/dbconfig-reinstall boolean false" | debconf-set-selections
|
||||||
|
echo "zoneminder zoneminder/mysql/admin-user string root" | debconf-set-selections
|
||||||
|
echo "zoneminder zoneminder/mysql/admin-pass password $ROOT_PASS" | debconf-set-selections
|
||||||
|
echo "zoneminder zoneminder/mysql/app-pass password $ZMPASS" | debconf-set-selections
|
||||||
|
echo "zoneminder zoneminder/app-password-confirm password $ZMPASS"| debconf-set-selections
|
||||||
|
|
||||||
{
|
{
|
||||||
echo "Database Credentials"
|
echo "ZoneMinder Database Credentials"
|
||||||
echo "Database User: $DB_USER"
|
echo "MySQL Root Password: $ROOT_PASS"
|
||||||
echo "Database Password: $DB_PASS"
|
echo "ZoneMinder DB User: zmuser"
|
||||||
echo "Database Name: $DB_NAME"
|
echo "ZoneMinder DB Pass: $ZMPASS"
|
||||||
} >> ~/$APP_NAME.creds
|
echo "ZoneMinder DB Name: zm"
|
||||||
msg_ok "MySQL setup completed"
|
} >> ~/zoneminder.creds
|
||||||
|
msg_ok "dbconfig pre-seeding complete"
|
||||||
|
|
||||||
# Enable the ZoneMinder PPA (iconnor/zoneminder-1.36) and install
|
# Enable the ZoneMinder PPA (iconnor/zoneminder-1.36) and install
|
||||||
msg_info "Enabling ZoneMinder PPA and installing ZoneMinder"
|
msg_info "Enabling ZoneMinder PPA and installing ZoneMinder"
|
||||||
|
Loading…
Reference in New Issue
Block a user