I have what is surely a remedial question for anyone with more Linux experience. I need to check if an operating system is already installed in my kickstart script, and if so, prompt the user if they would like to continue (basically reinstall) or to exit.
What is the most efficient way to do this?
I was thinking of doing something like the following:
%pre #!/bin/sh if [ -f some_file ]; then read -p "An OS already exists, do you want to re-install?" yn case $yn in [Yy]* ) break;; [Nn]* ) exit;; * ) echo "Please answer yes or no.";; esac fi
I'm not sure what file would be best to use in place of "some_file" in my example, or if this is even a good way to go about it.
Note that the reason I need to do this is because this Linux installation is part of a much larger automated installation so a user is not there to manually check if the OS exists already.