From 4ed6e4ff7f0f0666f761e4daacd8ef21ec77226a Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@robotics.uk.to>
Date: Wed, 30 Nov 2016 21:00:17 +0000
Subject: [PATCH] Schedule daily STIG tests

---
 src/freedombone-utils-cron  | 7 +++++++
 src/freedombone-utils-setup | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/src/freedombone-utils-cron b/src/freedombone-utils-cron
index 61484f863..193b19e86 100755
--- a/src/freedombone-utils-cron
+++ b/src/freedombone-utils-cron
@@ -77,4 +77,11 @@ function randomize_cron {
     mark_completed $FUNCNAME
 }
 
+function schedule_stig_tests {
+    echo '#!/bin/bash' > /etc/cron.daily/stig_tests
+    echo "pkill ${PROJECT_NAME}-tests" >> /etc/cron.daily/stig_tests
+    echo '${PROJECT_NAME}-tests --stig yes' >> /etc/cron.daily/stig_tests
+    chmod +x /etc/cron.daily/stig_tests
+}
+
 # NOTE: deliberately there is no "exit 0"
diff --git a/src/freedombone-utils-setup b/src/freedombone-utils-setup
index 22003a92f..5b8da91c7 100755
--- a/src/freedombone-utils-setup
+++ b/src/freedombone-utils-setup
@@ -751,6 +751,9 @@ function setup_utils {
 
     function_check limit_user_logins
     limit_user_logins
+
+    function_check schedule_stig_tests
+    schedule_stig_tests
 }
 
 function setup_email {
-- 
GitLab