Skip to content

Commit

Permalink
Remove auth keys and customization scripts from the new image (#61)
Browse files Browse the repository at this point in the history
* remove auth keys and customization scripts from the new image

Co-authored-by: Mayank Sharma <[email protected]>
  • Loading branch information
mayanks and Mayank Sharma authored Sep 15, 2021
1 parent 6ff0f1c commit 65a2496
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions startup_script/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,21 @@ function run_custom_script() {
fi
}

function cleanup() {
# .config and .gsutil dirs are created by the gsutil command. It contains
# transient authentication keys to access gcs bucket. The init_actions.sh and
# run.sh are your customization and bootstrap scripts (this) which must be
# removed after creating the image
rm -rf ~/.config/ ~/.gsutil/
rm ./init_actions.sh ./run.sh
}

function main() {
wait_until_ready

if [[ "${ready}" == "true" ]]; then
run_custom_script
cleanup
fi

echo "Sleep ${SHUTDOWN_TIMER_IN_SEC}s before shutting down..."
Expand Down

0 comments on commit 65a2496

Please sign in to comment.