diff options
author | Javier Sepulveda <javier.sepulveda@uv.es> | 2023-04-15 21:17:45 +0200 |
---|---|---|
committer | Javier Sepulveda <javier.sepulveda@uv.es> | 2023-04-15 21:17:45 +0200 |
commit | ae5c862d77b2f0b66e891378c2f7f6c28f157e85 (patch) | |
tree | 5d6af0e4e1b46e7b2c24c0850faf9bf3cfb2e0b8 | |
parent | 7c61daec311a376e7f2a30a026d58271a62146df (diff) | |
download | deployment-ae5c862d77b2f0b66e891378c2f7f6c28f157e85.tar.gz deployment-ae5c862d77b2f0b66e891378c2f7f6c28f157e85.tar.bz2 deployment-ae5c862d77b2f0b66e891378c2f7f6c28f157e85.zip |
Check services,distros and journald
-rwxr-xr-x | netzbon/check-distro.sh | 24 | ||||
-rwxr-xr-x | netzbon/config_journald.sh | 10 | ||||
-rwxr-xr-x | netzbon/install_packages.sh | 8 | ||||
-rwxr-xr-x | netzbon/main.sh | 4 |
4 files changed, 45 insertions, 1 deletions
diff --git a/netzbon/check-distro.sh b/netzbon/check-distro.sh new file mode 100755 index 0000000..4eb7b64 --- /dev/null +++ b/netzbon/check-distro.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +DISTRO=$(hostnamectl | grep 'Operating System' | cut -d ' ' -f 3-) + +echo $DISTRO + +COUNT=$(grep -c "$DISTRO" distros-supported.txt) + +echo $COUNT + +if [[ $COUNT -ne 1 ]]; then + echo "Distro not supported" + echo "Please check distro list ..." + sleep 10 + exit 1 +else + echo "Your distro is supported. Installation can continue ..." + sleep 3 +fi + + + + + diff --git a/netzbon/config_journald.sh b/netzbon/config_journald.sh new file mode 100755 index 0000000..d9399d8 --- /dev/null +++ b/netzbon/config_journald.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +mkdir -p /etc/systemd/journald.conf.d/ + +cat <<EOF > /etc/systemd/journald.conf.d/netzbon.conf +[Journal] +Storage=persistent +MaxFileSec=1week +Compress=yes +EOF diff --git a/netzbon/install_packages.sh b/netzbon/install_packages.sh index 9b77705..fdfdb5a 100755 --- a/netzbon/install_packages.sh +++ b/netzbon/install_packages.sh @@ -7,7 +7,13 @@ source functions.sh source config/user.conf source config/internal.conf -detect_distro +# Check distro, if not supported echo and exit + +./check-distro.sh + +# Configure logs with journalD + +./config_journald.sh # Program versions PG_VERSION=14 diff --git a/netzbon/main.sh b/netzbon/main.sh index 52f5f67..cb24172 100755 --- a/netzbon/main.sh +++ b/netzbon/main.sh @@ -115,6 +115,10 @@ else PROTO="http" fi +#Check services, and if down restart + +./check-services.sh + say "Congratulations, you have successfully installed GNU Taler" say "Your bank is at ${PROTO}://bank.${DOMAIN_NAME}/" say "A merchant is at ${PROTO}://backend.${DOMAIN_NAME}/" |