Debconf dialog during .deb installation

I was able to successfully create the .deb installation file for Ubuntu, but I need to enter user input to complete the setup of the post install script. These questions are dynamic and based on the interfaces that the user has on his computer.

Is there a way to ask the user questions with dynamic answers (i.e. a list of interfaces on their computer) during the installation process in Ubuntu Software Center using debconf?

+4
source share
1 answer

Got it. In the template file, you create a lookup variable and populate it inside the configuration file.

Template File:

Template: pkg/interfaces Type: select Choices: ${choices} Description: ..... 

The configuration file:

 declare -a options; count=0; ## Get interfaces from the operating system for interface in $(ip link show | awk '/^[0-9]/ {print $2;} ' | sed 's/:$//'); do if [ $interface != "lo" ] && [ $interface != "" ] ; then options[$count]=$interface; count=$((count+1)); fi done # Set the choices the user has db_subst pkg/outface choices $options 
+3
source

All Articles