chg: Fixed reboot necessity, meaning, just check if reboot works end-of-stage.

new: [cron] Added provisional crontab. Will be augmented greatly, soon(tm)
pull/11/head
Steve Clement 2018-11-22 00:42:37 +09:00
parent 6c9aa1a0bc
commit 223401d498
3 changed files with 18 additions and 3 deletions

6
conffiles/crontab Normal file
View File

@ -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]

View File

@ -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"
}
],

View File

@ -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