From c527ec90ef4d477ddd98ad76733252afc93d07d8 Mon Sep 17 00:00:00 2001
From: barremian <machinetime77@gmail.com>
Date: Wed, 29 May 2024 10:41:17 +0200
Subject: [PATCH] lxc-forgejo: Expand unbound variables to empty strings to
 suppress 'unbound variable' errors

---
 install/forgejo-install.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/install/forgejo-install.sh b/install/forgejo-install.sh
index 9ee7bbd7..40e39e9a 100644
--- a/install/forgejo-install.sh
+++ b/install/forgejo-install.sh
@@ -138,15 +138,15 @@ cat <<EOF >/etc/systemd/system/forgejo.service
 Description=Forgejo
 After=syslog.target
 After=network.target
-$(if [[ -n "$DB_CHOICE" && "$DB_CHOICE" == "PostgreSQL" ]]; then
+$(if [[ -n "${DB_CHOICE:-}" && "${DB_CHOICE}" == "PostgreSQL" ]]; then
 echo -e "Wants=postgresql.service"
 echo -e "After=postgresql.service"
 fi)
-$(if [[ -n "$DB_CHOICE" && "$DB_CHOICE" == "MySQL" ]]; then
+$(if [[ -n "${DB_CHOICE:-}" && "$DB_CHOICE" == "MySQL" ]]; then
 echo -e "Wants=mysql.service"
 echo -e "After=mysql.service"
 fi)
-$(if [[ -n "$DB_CHOICE" && "$DB_CHOICE" == "MariaDB" ]]; then
+$(if [[ -n "${DB_CHOICE:-}" && "$DB_CHOICE" == "MariaDB" ]]; then
 echo -e "Wants=mariadb.service"
 echo -e "After=mariadb.service"
 fi)