added deploy script

cleanup function, first feature I wanted
This commit is contained in:
Bryan Joshua Pedini 2021-01-11 10:12:48 +01:00
parent 8ace396142
commit bc6b382058
1 changed files with 11 additions and 0 deletions

11
deploy.sh Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
THIS="$(pwd)"
_cleanup() {
echo -e "#!/usr/bin/env bash" >> /tmp/deploy_cleanup.sh
echo -e "rm -rf ${THIS}" >> /tmp/deploy_cleanup.sh
echo -e "crontab -l | sed '/# REF:deploy_cleanup:REF/Q' | crontab -" >> /tmp/deploy_cleanup.sh
chmod +x /tmp/deploy_cleanup.sh
echo -e "$(crontab -l)\n# REF:deploy_cleanup:REF\n* * * * *\t/tmp/deploy_cleanup.sh" | crontab -
}