-1

我正在尝试编写一个脚本来jitsi-meet自动安装。

在安装过程中,会出现一个对话框。我可以从脚本中自动输入字段的值并进行模拟ENTER,以便无需任何人工干预即可安装吗?

4

1 回答 1

2

在对该主题进行更多研究后,我发现没有简单的脚本可以编写来自动输入值。

我发现的唯一可能的解决方案是:

  1. Debconf [Thank You, Mark Setchell] 如果应用程序支持它,您可以简单地使用 debconf 预先设置值。
  2. 将值作为参数传递。如果应用程序支持它,您可以在 CLI 中将值作为参数传递。

特别是在 jitsi-meet 的情况下,您可以借助 debconf 设置值。安装 debconf-utils:sudo apt install debconf-utils

然后,用于debconf-get-selections | grep jitsi查看已设置的值并更改值(或设置新值):

echo "jitsi-videobridge jitsi-videobridge/jvb-hostname string my-domain" | debconf-set-selections
echo "jitsi-meet jitsi-meet/cert-choice select Self-signed certificate will be generated" | debconf-set-selections
Or
echo "jitsi-meet jitsi-meet/cert-path-crt string /etc/ssl/my-domain.crt" | debconf-set-selections
echo "jitsi-meet jitsi-meet/cert-choice select A certificate is available and the files are uploaded on the server" | debconf-set-selections
echo "jitsi-meet jitsi-meet/cert-path-key string /etc/ssl/my-domain.key" | debconf-set-selections

您可以 sudo DEBIAN_FRONTEND=noninteractive apt-get -y install jitsi-meet在安装时使用以避免交互式输入屏幕。:)

于 2018-01-21T16:27:45.983 回答