diff options
author | DL6ER <dl6er@dl6er.de> | 2021-03-18 11:04:09 +0300 |
---|---|---|
committer | DL6ER <dl6er@dl6er.de> | 2021-03-18 18:46:59 +0300 |
commit | f536718aaab7fd4ed1d22a9b0e5f3357cc1f9efb (patch) | |
tree | c288ad5d559582056935b7f30ec40775a179cfcf /gravity.sh | |
parent | f1740da9ffcbabc58b56107d2e1131aae380dd90 (diff) |
Use possibly custom gravity.db location in the copying SQL script
Signed-off-by: DL6ER <dl6er@dl6er.de>
Diffstat (limited to 'gravity.sh')
-rwxr-xr-x | gravity.sh | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -90,7 +90,7 @@ generate_gravity_database() { # Copy data from old to new database file and swap them gravity_swap_databases() { - local str + local str copyGravity str="Building tree" echo -ne " ${INFO} ${str}..." @@ -107,7 +107,14 @@ gravity_swap_databases() { str="Swapping databases" echo -ne " ${INFO} ${str}..." - output=$( { sqlite3 "${gravityTEMPfile}" < "${gravityDBcopy}"; } 2>&1 ) + # Gravity copying SQL script + copyGravity="$(cat "${gravityDBcopy}")" + if [[ "${gravityDBfile}" != "${gravityDBfile_default}" ]]; then + # Replace default gravity script location by custom location + copyGravity="${copyGravity//"${gravityDBfile_default}"/"${gravityDBfile}"}" + fi + + output=$( { sqlite3 "${gravityTEMPfile}" <<< "${copyGravity}"; } 2>&1 ) status="$?" if [[ "${status}" -ne 0 ]]; then |