【发布时间】:2011-03-03 17:43:42
【问题描述】:
所以当我创建一个 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。有没有接受用户输入的好方法?据我了解,RPM 旨在不允许交互式安装。但是我看不到更好的方法来做到这一点..
有没有办法在不询问用户的情况下自动查找本地 MySQL 设置?否则,询问用户输入的最佳方式是什么?
【问题讨论】:
-
在 Debian 中,你应该使用
debconf来配置你的包。 -
感谢 el.pescado,我目前正在阅读 debconf-devel 的手册页。我意识到我为 ubuntu 做的有点不对,哈哈。那么,Fedora 有没有等价物?