如何通过Shell脚本在CentOS的Vagrant环境中无Puppet安装SoapUI
Question:
I want to install SoapUI using a shell script with Vagrant, and I don't want to use Puppet (I'm not familiar with it). I've written the following script so far:
# Download SoapUI echo "Download SoapUI" cd ~ wget https://s3.amazonaws.com/downloads.eviware/soapuios/5.4.0/SoapUI-x64-5.4.0.sh chmod 755 SoapUI-x64-5.4.0.sh # Install SoapUI sh ./SoapUI-x64-5.4.0.sh
However, the installation process brings up a console wizard. I want to complete the installation with default values directly (including accepting the license agreement). Has anyone solved this and is willing to share the solution?
Answer:
Sure thing! I've run into this exact issue before with SoapUI's Install4j-based installer. Here's how you can modify your script to do a fully silent installation with all default settings, including accepting the license agreement automatically:
Modified Shell Script
# Download SoapUI echo "Downloading SoapUI..." cd ~ wget https://s3.amazonaws.com/downloads.eviware/soapuios/5.4.0/SoapUI-x64-5.4.0.sh chmod 755 SoapUI-x64-5.4.0.sh # Silent install with default settings and auto-accept license echo "Installing SoapUI silently..." sh ./SoapUI-x64-5.4.0.sh --silent --accept-license
What do these parameters do?
--silent: Tells the Install4j installer to run in non-interactive mode, skipping all console prompts and using default installation settings (like default install directory, components, etc.).--accept-license: Automatically accepts the SoapUI license agreement, which is required to proceed with the silent install.
Vagrant Integration Tip
To use this script with Vagrant, just add it as a shell provisioner in your Vagrantfile:
Vagrant.configure("2") do |config| # Your existing VM config goes here... # Run the SoapUI install script on provision config.vm.provision "shell", path: "path/to/your/install_soapui.sh" end
This will trigger the silent installation automatically when you run vagrant up or vagrant provision.
内容的提问来源于stack exchange,提问作者Michael Hegner

