[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debconf: asking several questions more than once



Patrick Schönfeld wrote:
> Hi people,
> 
> as i just finished a current version of mantis got it uploaded by Daniel
> (thanks for that!) i have re-started working on smstools. Because the
> upstream author and me detected that installation can lead into a
> defunct state (because smsd is started, even though maybe there is no
> appropriate config), i thought about implementing a series of debconf
> questions to preconfigure smsd if the user wants to do so.
> Thats no problem so far.
> But there is one thing I'm not sure how to implement. Users can use up
> to 32 modems with smstools. Even though i don't think that is a common
> setup i would like to give them a chance to configure more than one
> modem. But i am a bit unsure how to do this.
> Off course i know that i can loop in my config script, but how to ask
> several questions again and again and store the answers so i can process
> them in the postinst? I heard about the db_register command, but i
> haven't seen a concrete example so far and so i am a bit curious about
> how to do this.

for x in $(seq 1 32); do
	db_register my/template my/question/$x
	db_input high my/question/$x
	db_go
done

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature


Reply to: