Commit 9286a2f9 authored by Daniel's avatar Daniel

Update overlay/root/scripts/mysql_config.sh, __dev__update_git.sh files

parent 449ef52a
#!/bin/sh
cd /root/nextcloud/
git config pull.rebase true
dir_git_nc=/root/nextcloud
check_installed_package(){
local package_name=$1
result="$(pkg info $1 2>&1 | sed -n -e '/No package/p')"
if [ -z "$result" ]; then
echo true
else
echo false
fi
return 0
}
if ! $(check_installed_package git); then pkg install git; fi
if [ ! -d "$dir_git_nc" ]; then
git clone https://code.myprivatesite.de/iocage-plugins/nextcloud.git $dir_git_nc
rsync -a ${dir_git_nc}/overlay/ /
git config pull.rebase true
else
cd ${dir_git_nc}
git pull
rsync -a ${dir_git_nc}/overlay/scripts /root/scripts
fi
git pull
rsync -a /root/nextcloud/overlay/ /
......@@ -32,12 +32,12 @@ alias mysqlr="mysql --user=root --password=\"${DB_ROOT_PW}\""
# create the dbuser (fix for mysql >= 8)
# mysql -u root -e "CREATE USER '${DB_ROOT}'@'localhost' IDENTIFIED BY '${DB_ROOT_PW}';"
echo "mysql: setting up user ${DB_ROOT}"
mysqlr "CREATE USER '${DB_ROOT}'@'localhost' IDENTIFIED WITH mysql_native_password BY '${DB_ROOT_PW}';"
mysqlr "GRANT ALL PRIVILEGES ON *.* TO '${DB_ROOT}'@'localhost' WITH GRANT OPTION;"
mysqlr "FLUSH PRIVILEGES;"
mysqlr -e "CREATE USER '${DB_ROOT}'@'localhost' IDENTIFIED WITH mysql_native_password BY '${DB_ROOT_PW}';"
mysqlr -e "GRANT ALL PRIVILEGES ON *.* TO '${DB_ROOT}'@'localhost' WITH GRANT OPTION;"
mysqlr -e "FLUSH PRIVILEGES;"
# create nextcloud db with extended character set and add user as admin
echo "mysql: setting up database ${DB_NAME}"
mysqlr "CREATE DATABASE IF NOT EXISTS ${DB_NAME} CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
mysqlr "GRANT ALL PRIVILEGES on ${DB_NAME}.* to '${DB_ROOT}'@'localhost';"
mysqlr "FLUSH PRIVILEGES;"
mysqlr -e "CREATE DATABASE IF NOT EXISTS ${DB_NAME} CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
mysqlr -e "GRANT ALL PRIVILEGES on ${DB_NAME}.* to '${DB_ROOT}'@'localhost';"
mysqlr -e "FLUSH PRIVILEGES;"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment