A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys, Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun VPN routing, and a web dashboard to manage it all. Free & open forever to self-host; optional paid hosted services fund it. See PROMISE.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
36 lines
1.2 KiB
Bash
Executable File
36 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
installSQLiteDatabase()
|
|
{
|
|
if [[ $CFG_REQUIREMENT_DATABASE == "true" ]]; then
|
|
# Safeguard loading
|
|
if [ ! -e "$docker_dir/$db_file" ]; then
|
|
if command -v sqlite3 &> /dev/null; then
|
|
isHeader "Setup SQLite Database"
|
|
|
|
# Create SQLite database file
|
|
if [ ! -e "$docker_dir/$db_file" ]; then
|
|
local result=$(sudo touch $docker_dir/$db_file)
|
|
checkSuccess "Creating SQLite $db_file file"
|
|
|
|
local result=$(sudo chmod 755 $docker_dir/$db_file && sudo chown $sudo_user_name $docker_dir/$db_file)
|
|
checkSuccess "Changing permissions for SQLite $db_file file"
|
|
fi
|
|
|
|
databaseCreateTables;
|
|
|
|
# Get list of table names from database
|
|
sql_table_names=$(sqlite3 "$docker_dir/$db_file" ".tables")
|
|
|
|
# Loop through table names and print the desired text
|
|
for sql_table_name in $sql_table_names; do
|
|
isSuccessful "Table $sql_table_name found in database."
|
|
done
|
|
fi
|
|
else
|
|
# Make sure tables are always setup
|
|
databaseCreateTables;
|
|
fi
|
|
fi
|
|
}
|