Pre-Test Push

This commit is contained in:
2023-05-27 15:54:28 -05:00
parent 84133c9315
commit 81689667e2
5 changed files with 17 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ declare -a crontab_dirs=(
)
declare -a crontabs_in_db
sqlite_cmd="sqlite3 $WEBCRON_DB"
sqlite_cmd="sqlite3 webcron.db"
for name in $( $sqlite_cmd <<< "SELECT crontab_path FROM crontabs;"); do
@@ -30,7 +30,7 @@ for dir in ${crontab_dirs[@]}; do
$sqlite_cmd "
INSERT INTO crontabs (crontab_path, crontab_data) VALUES
('$file',
'$($"$(<$file)")');
'$(cat $file)');
" # (2023-05-15)
# Had to add the $"..." to the statement above because the script was attempting to load
# and execute the script on trying to load it into the db
@@ -51,7 +51,7 @@ while read crontab_id crontab_path; do
# loaded into the db.
if [[ -f "$crontab_path" ]] && [[ ! "$data" == "$(<$crontab_path)" ]]; then
sqlite3 $WEBCRON_DB "
UPDATE crontabs SET crontab_data = '$($"(<$crontab_path)")' WHERE crontab_id = $crontab_id
UPDATE crontabs SET crontab_data = '$(<$crontab_path)' WHERE crontab_id = $crontab_id
" # (2023-05-15)
# Had to add the $"..." to the statement above because the script was attempting to load
# and execute the script on trying to load it into the db