All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Best way to test bash scripts?
So I've been working on a bash script that just sets up and configures servers for me, it's not too much different from the many already available but I'm doing it more for the learning aspect and the time savings when setting up new servers.
I currently have a dev VPS that I test this on, but it's becoming a pain in the ass to reload the OS, re-run the updated script and wait while it does everything again, only to find out I forgot a damn "\" in front of a "$" somewhere and repeat the process.
It's the whole reloading the OS and re-executing the script that is taking the most time. Even on a local VM, this is troublesome.
Just curious what you guys do when developing bash scripts.
Comments
Why not run it locally with VMWare Player or Virtual Box? On my PC and netbook I have 4 "clean" installs of Vyatta, CentOS, Arch Linux, and Fedora that I use for testing. If I need a Fedora install (Linux + GUI) then I'll just copy over the folder and use that copy to test with, then delete the copy.
I do use Virtual Box sometimes, but even then it can become a bit of a headache. I didn't know if those were the best options or if, I don't know, there was some other option available =]
I remember somebody telling me that they used some sort of setup where they mounted an image of the OS and after a reboot the OS went back to the image state and all charges were reverted. No idea how he did this but I do remember having similar software on the computers at my high school.
Hmm, I'll see what I can conjure up.
On an un-related note, I sent you a PM a week or so ago, haven't heard back.
@KuJoe http://www.faronics.com/enterprise/deep-freeze/
Too bad it doesn't work on Linux
Edit: http://www.webupd8.org/2010/08/ofris-deep-freeze-like-application-for.html maybe?
Also http://piecesoflint.wordpress.com/2011/04/04/linfreeze-deep-freeze-like-software-for-linux/
Virtualbox or similar is really what you want. You can create snapshots and rollback to them. As you make progress, create snapshots.
is very quick but no needs backups for clean fresh install, just drop it.
exactly what i do with centmin mod.. virtualbox snapshot/restore saves alot of time
run the script bit by bit, line by line
or keep editing the command and only append it to the bash script after you get it right
Proxmox... yiak. too much stuff to do before start.
Vmware and snapshots is the coolest thing ever, but isn't free.
Take a snapshot of your stuff, break, restore, break again, repeat.
VMware is awesome.
Debootstrap and Chroot.
i have a private openvz node at my house, nothing powerful just a old c2d laptop
that i use for testing scripts/setups so i don't have to touch anything thats in a live environment
Grab the ISO (centos etc) and fire up VMWare on your desktop
+1 snap