diff --git a/software/slaprunner/common.cfg b/software/slaprunner/common.cfg index e7951e02bb87230ff9ee98c85cc8213b4da1f164..6ed9c80ab4586ac1682e14ae2854fa89a974f271 100644 --- a/software/slaprunner/common.cfg +++ b/software/slaprunner/common.cfg @@ -52,7 +52,7 @@ mode = 0644 recipe = hexagonit.recipe.download url = ${:_profile_base_location_}/template/runner-import.sh.jinja2 download-only = true -md5sum = bd2df050fd40c3f31f29cc9daebebfe3 +md5sum = f7594f522e7350d5394c7ae3c058154c filename = runner-import.sh.jinja2 mode = 0644 diff --git a/software/slaprunner/template/runner-import.sh.jinja2 b/software/slaprunner/template/runner-import.sh.jinja2 index 56badee6decc9f1d137390a7413cf7110accad0a..039a65005e307902a2b05fa6259577b8f6dd6807 100644 --- a/software/slaprunner/template/runner-import.sh.jinja2 +++ b/software/slaprunner/template/runner-import.sh.jinja2 @@ -31,12 +31,24 @@ restore_element {{ directory['backup'] }}/etc/ {{ directory['etc'] }} config.js cp -r {{ directory['backup'] }}/etc/.??* {{ directory['etc'] }}; {{ curl_binary }} --insecure -vg6L --max-time 5 {{ backend_url }}/isSRReady; -if [ -e $srv_directory/runner-import-restore ]; then - touch $srv_directory/runner-import-restore - chmod +x $srv_directory/runner-import-restore -fi # Invoke arbitrary script to perform specific restoration # procedure. +runner_import_restore=$srv_directory/runner-import-restore +if [ ! -e "$runner_import_restore" ]; then + touch $runner_import_restore + chmod +x $runner_import_restore +fi +echo "Running $runner_import_restore script..." $srv_directory/runner-import-restore + +# Invoke defined scripts for each partition inside of slaprunner +for partition in $srv_directory/runner/instance/slappart*/ +do + script=$partition/srv/runner-import-restore + if [ -e "$script" ]; then + echo "Running $script script..." + $script + fi +done