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
But every
How can I make this sort of sample code work inside a .pkg script?
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 $#"