Pre-Test Push

This commit is contained in:
Tristan Ancelet 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

2
Site

@ -1 +1 @@
Subproject commit dbc5587bb686dfdadccd5baa315535317e91a595
Subproject commit b8ba9dc5d46ebc968820ec10d30809323caa0806

13
test.php Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/php
<?php
require('Site/Libraries/table/class.php');
$table = new Table("crontabs");
$db = new SQLite3("webcron.db");
$table->Load($db, "");
echo $table->get_html();
?>

0
webcron Normal file
View File

0
webcrond.db Normal file
View File