[CentOS] Passing password to script for rpmsign of list of .rpm files

Sat May 21 16:02:40 UTC 2011
Ljubomir Ljubojevic <office at plnet.rs>

Johnny Hughes wrote:
> On 05/20/2011 01:13 PM, Keith Roberts wrote:
>> On Fri, 20 May 2011, Ljubomir Ljubojevic wrote:
>>
>>> To: CentOS mailing list <centos at centos.org>
>>> From: Ljubomir Ljubojevic <office at plnet.rs>
>>> Subject: [CentOS] Passing password to script for rpmsign of list of .rpm files
>>>
>>> I am trying to automatize signing of unsigned .rpm files. My repo has at
>>> least 50 x 3 packages.
>>>
>>> But I would have to type numerous passwords for each file. I can not see
>>> hot to pass pass phrase to script.
>>>
>>> rpmsign --resign {--pass=??} <filename from list> ????
>>>
>>> Can someone advise me how to do that?
>>>
>> Hi Ljubomir.
>>
>> Not sure if this would work for signing packages, but I use 
>> this script to start all services listed in a text file:
>>
>> #!/bin/bash
>>
>> # Start all services on machine
>>
>> echo
>> echo 
>> "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
>> echo "Running script: $0"
>> echo 
>> "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
>> echo
>>
>> # start all services listed in service-names
>> xargs -a ./service-names -i chkconfig --level 2345 {} on
>>
>> # list the status of services in service-names file
>> echo "All services are now turned on (all those listed in 
>> service-names file)
>> "
>> echo "for run levels 2345"
>> echo
>> xargs -a ./service-names -i chkconfig --list {}
>> echo
>>
>> exit 0
>>
>> You may be able to modify the above script to do what you 
>> need it to. xargs is in the findutils package:
>>
>> Name       : findutils
>> Arch       : i386
>> Epoch      : 1
>> Version    : 4.2.27
>> Release    : 6.el5
>> Size       : 662 k
>> Repo       : installed
>> Summary    : The GNU versions of find utilities (find and xargs).
>> URL        : http://www.gnu.org/software/findutils/
>> License    : GPL
>>
>> Description: The findutils package contains programs which 
>> will help you locate files on your system.  The find utility 
>> searches through a hierarchy of directories looking for 
>> files which match a certain set of criteria (such as a 
>> filename pattern).  The xargs utility builds and executes 
>> command lines from standard input arguments (usually lists 
>> of file names generated by the find command).
> 
> I don't think he wants to find the files ... I think he wants to know
> how to pass in a passwd for signature.
> 
> Can't you just do this in the script:
> 
> rpm --resign <options, names and crap>  <<EOF
> <passwd>
> EOF
> 
Script is already done:
http://lists.centos.org/pipermail/centos/2011-May/111937.html

I made a mistake and broke the thread, so guys replied there.

Ljubomir