diff --git a/conffiles/crontab b/conffiles/crontab new file mode 100644 index 0000000..3f300fc --- /dev/null +++ b/conffiles/crontab @@ -0,0 +1,6 @@ +### Very early stage crontab. This will completed soon(tm) +#@daily /var/www/MISP/app/Console/cake Server pull [user_id] [server_id] [full|update] +#@monthly /var/www/MISP/app/Console/cake Server push [user_id] [server_id] +#@hourly /var/www/MISP/app/Console/cake Server fetchFeed [user_id] [feed_id|all|csv|text|misp] +#@weekly /var/www/MISP/app/Console/cake Server cacheFeed [user_id] [feed_id|all|csv|text|misp] +#@daily /var/www/MISP/app/Console/cake Event enrichEvent [user_id] [event_id] [json_encoded_module_list] diff --git a/misp.json b/misp.json index ed1b57a..38909aa 100644 --- a/misp.json +++ b/misp.json @@ -163,6 +163,11 @@ "script": "scripts/bootstrap.sh", "pause_before": "10s" }, + { + "type": "file", + "source" : "conffiles/crontab", + "destination": "/tmp/crontab" + }, { "type": "file", "source" : "conffiles/issue", @@ -171,7 +176,9 @@ { "type": "shell", "execute_command" : "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'", - "script": "scripts/clean.sh" + "script": "scripts/clean.sh", + "expect_disconnect": "true", + "pause_before": "30s" } ], diff --git a/scripts/clean.sh b/scripts/clean.sh index 7b3f5cf..f66ba1e 100644 --- a/scripts/clean.sh +++ b/scripts/clean.sh @@ -1,6 +1,7 @@ #! /usr/bin/env bash -cp /tmp/issue /etc/issue +mv /tmp/issue /etc/issue +mv /tmp/crontab /etc/cron.d/misp # package echo "--- autoremove for apt ---" @@ -10,5 +11,6 @@ echo "--- Cleaning packages" apt-get -y clean > /dev/null 2>&1 # End Cleaning -echo "VM cleaned" +echo "VM cleaned and rebooting for automagic reas0ns." +reboot