Skip to content

Commit

Permalink
chg: Fixed reboot necessity, meaning, just check if reboot works end-…
Browse files Browse the repository at this point in the history
…of-stage.

new: [cron] Added provisional crontab. Will be augmented greatly, soon(tm)
  • Loading branch information
SteveClement committed Nov 21, 2018
1 parent 6c9aa1a commit 223401d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions conffiles/crontab
Original file line number Diff line number Diff line change
@@ -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]
9 changes: 8 additions & 1 deletion misp.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@
"script": "scripts/bootstrap.sh",
"pause_before": "10s"
},
{
"type": "file",
"source" : "conffiles/crontab",
"destination": "/tmp/crontab"
},
{
"type": "file",
"source" : "conffiles/issue",
Expand All @@ -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"
}
],

Expand Down
6 changes: 4 additions & 2 deletions scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -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 ---"
Expand All @@ -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

0 comments on commit 223401d

Please sign in to comment.