0

Ubuntu 18.04.1 の preseed ファイルからこの bash ファイルを読み込んで実行しています。インストールは完全に機能し、bash ファイルがダウンロードされて実行されますが、エラーが発生します。

エラー メッセージ:「アクティベーション/アスクが存在しません」。これをトラブルシューティングしてdebconf dev構成を読み取ろうとしましたが、何が間違っているのかを実際に特定できません。何か案は?ありがとう

編集:インストール中にシェルに移動し、wget、この post.sh スクリプトを chmod すると、すべて正常に動作します。何か案は?

#!/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

テンプレートの名前が変更されるため、そこでの不一致について心配する必要はありません。ありがとう

エラー

4

1 に答える 1

0

これは、スクリプトの実行方法に関係していました。

d-i preseed/late_command string \
in-target /usr/bin/wget -O /root/post.sh http://<ip>/preseed/post.sh; \
in-target /bin/chmod +x /root/post.sh; \
in-target /bin/bash /root/post.sh
于 2019-01-30T14:35:36.980 に答える