我正在从 Ubuntu 18.04.1 上的预置文件加载和执行这个 bash 文件。安装工作完美,我的 bash 文件已下载并执行,但出现错误。
错误消息:“激活/询问不存在”。我尝试对此进行故障排除并阅读 debconf 开发配置,但无法真正确定我做错了什么。有任何想法吗?谢谢
编辑:如果我在安装和 wget 期间进入 shell,chmod 这个 post.sh 脚本,一切正常。有任何想法吗?
#!/bin/sh
# Library to interact with debconf.
. /usr/share/debconf/confmodule
# Create the template file
cat > /tmp/activate.template <<EOL
Template: activation/title
Type: text
Description: Activate
Template: activation/ask
Type: string
Description: Enter Activation Code
EOL
# Load your template
debconf-loadtemplate activation /tmp/activate.template
# Set title for dialogue box
db_settitle activation/title
# Input activation code
db_input critical activation/ask
db_go
# Fetch input from user
db_get activation/ask
# Save it to a file
echo "$RET" > /root/answer.value
#Error message: activation/ask does not exist
模板已重命名,因此不必担心那里的不匹配。谢谢