Using interactive +..INSTALL scripts in packages

I'm placing this thread here instead of "Installation and Maintenance..." because it doesn't pertain to any package in the FreeBSD repo. Apologies and thank you for adjusting if that's not appropriate.

Rather, I'm trying to create a package in my own repo which engages the user in an interactive dialog to set some config options but only when BATCH mode is NOT set, and the package is a first-time install. First-time install is defined as config file foo.conf does not exist. The script will always install (or update) foo.conf.sample, and ONLY when foo.conf doesn't already exist, the script asks some questions and customizes foo.conf.sample to create foo.conf.

But every read in a +PRE_INSTALL or +POST_INSTALL script acts like stdin has been /dev/null-ed.

How can I make this sort of sample code work inside a .pkg script?

Bash:
# cat -- +PRE_INSTALL
read -p 'Gimme five: ' five
set -- $five
echo "You gave me $#"
 
… trying to create a package in my own repo which engages the user in an interactive dialog to set some config options but only when BATCH mode is NOT set, and the package is a first-time install. …

I doubt that it's possible. The Porter's Handbook might have an authoritative answer.

You can use a package message to encourage the reader to manually run something after installation.
 
Back
Top