0

My kickstart script is like this:

%pre --log=/tmp/log
wget --no-check-certificate http://192.168.2.33/file
[ $? -eq 0 -a -f file ] && tar --ignore-failed-read -xzvf file
....
%end 

wget command fails as the file is not available in the server. Now, I want the script to be stopped executing the installation any further and fails immediately when it sees any error with the corresponding error message showing up on the terminal screen

I stumbled upon this option --erroronfail but it only shows the Python exception traceback calls in the console without the actual error string to show to the user why it is failed.

I have tried the following ways:

%pre --interpreter /bin/sh --log=/tmp/log --erroronfail
exec < /dev/tty3 > /dev/tty3
chvt 3
wget --no-check-certificate http://192.168.2.33/file
[ $? -eq 0 -a -f file ] && tar --ignore-failed-read -xzvf file 
chvt 1
%end

and as below too

%pre --interpreter /bin/sh --log=/tmp/log --erroronfail
exec < /dev/tty3 > /dev/tty3
chvt 3
wget --no-check-certificate http://192.168.2.33/file 2>&1 | /usr/bin/tee -a /tmp/log
chvt 1
%end

Nothing gives me the expected result

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.