scale-catalog/jails/mariadb/update.sh
Kjeld Schouten-Lebbing cd5adfd94b
Jailman v1.1.0 (#24)
* set branch (+2 squashed commit)

Squashed commit:

[e322f24] remove placeholder

[8647131] palceholder

* Code cleanup and (primarily) consolidation (#21)

* set branch

* Exit 1 on iocage create failure

* - Move jailcreate to global function
- Remove Jailcreate.sh

* Add dataset creation function

* - add test script to test new global changes
- also create folder in jail with createmount

* fix

* make test executable

* more verbosity, fixing folder creation

* moving global dataset create

* move jails to new dataset-mount creation function

* remove test jail and test branch-ref

* Add Nextcloud (#22)

* Basic working nextcloud integration

* Enable persistent reinstall of Nextcloud

* prepare for dev merge

* Licence alert

* Add external database and integrated jail

* small improvements and update script

* Add mariadb to dev (#31)

* Working MariaDB config

* - Set ZFS settings for DB on Nextcloud and MariaDB
- Cleanup MariaDB

* prepare for dev merge

* Niceify Readme (#34)

* put content from master into it

* Some readme itteration

* more niceification

* [WIP} Wiki workflow test (#37)

introduce automatic wiki generation

* Add Bitwarden support (#35)

* Nextcloud-Cleanup for v1.1.0 (#40)

* Nextcloud cleanup
- add db-type sanity check
- remove some integrated db checks
- Move ssl to /config/ssl
- remove integrated databases

* slight default tweaking

* fix mariadb install bug

* QA cycle
2020-03-13 23:59:05 +01:00

34 lines
1.2 KiB
Bash
Executable File

#!/usr/local/bin/bash
# This file contains the update script for mariadb
JAIL_NAME="mariadb"
JAIL_IP="$(sed 's|\(.*\)/.*|\1|' <<<"${mariadb_ip4_addr}" )"
INCLUDES_PATH="${SCRIPT_DIR}/jails/mariadb/includes"
# Install includes fstab
iocage exec "${JAIL_NAME}" mkdir -p /mnt/includes
iocage fstab -a "${JAIL_NAME}" "${INCLUDES_PATH}" /mnt/includes nullfs rw 0 0
iocage exec ${JAIL_NAME} service caddy stop
iocage exec ${JAIL_NAME} service php-fpm stop
fetch -o /tmp https://getcaddy.com
if ! iocage exec "${JAIL_NAME}" bash -s personal "${DL_FLAGS}" < /tmp/getcaddy.com
then
echo "Failed to download/install Caddy"
exit 1
fi
# Copy and edit pre-written config files
echo "Copying Caddyfile for no SSL"
iocage exec "${JAIL_NAME}" cp -f /mnt/includes/caddy /usr/local/etc/rc.d/
iocage exec "${JAIL_NAME}" cp -f /mnt/includes/Caddyfile /usr/local/www/Caddyfile
iocage exec "${JAIL_NAME}" sed -i '' "s/yourhostnamehere/${mariadb_host_name}/" /usr/local/www/Caddyfile
iocage exec "${JAIL_NAME}" sed -i '' "s/JAIL-IP/${JAIL_IP}/" /usr/local/www/Caddyfile
# Don't need /mnt/includes any more, so unmount it
iocage fstab -r "${JAIL_NAME}" "${INCLUDES_PATH}" /mnt/includes nullfs rw 0 0
iocage exec ${JAIL_NAME} service caddy start
iocage exec ${JAIL_NAME} service php-fpm start