1
因此,当我创建一个debian软件包时,我可以编写一个运行良好的安装后shell脚本。目前我的配置可以做如何在安装过程中接受用户输入
echo "Please enter your MySQL Database user (default root)"
read MYSQL_USER
echo "Please enter the MySQL Database user password (default root)"
read -s MYSQL_PASS
DBEXIST=0
CMD="create database lportal;use lportal;"
(mysql -u$MYSQL_USER -p$MYSQL_PASS -e "$CMD") || ((DBEXIST++))
if [ $DBEXIST -ne 0 ]; then
echo "Setup finished, but MySQL already has an lportal table. This could be from a previous installation of Liferay. If you want a fresh installation of this bundle, please remove the lportal table and reinstall this package."
fi
这对Ubuntu很好用。但是,我似乎无法获得用户输入来处理Fedora RPM。有没有一种好的方法来接受用户输入?据我所知,RPMs被设计为不允许交互式安装。然而我看不到一个更好的方法来做到这一点..
有没有可能的方式来自动查找本地MySQL设置而不询问用户?否则,要求用户输入的最佳方式是什么?
在Debian中,你应该使用'debconf'来配置你的包。 – 2010-06-14 21:47:46
谢谢el.pescado,我目前正在阅读debconf-devel的手册页。我意识到我为Ubuntu做了这样的错,哈哈。 那么Fedora有没有等价物? – Sam 2010-06-14 22:01:31