/[cwmp]/google/test_files/set_vouchers_gen.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /google/test_files/set_vouchers_gen.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (hide annotations)
Sat May 19 15:15:14 2007 UTC (17 years ago) by dpavlin
File MIME type: application/x-sh
File size: 857 byte(s)
initial import of cruft around TR-069

1 dpavlin 2 #!/bin/bash
2    
3     # Generate SetVouchers Request
4     RES=set_vouchers.txt
5    
6     VOUCHERS=$*
7     BASE64=/tmp/base64
8    
9     # Create file header
10     echo 'Name: SetVouchers method' > $RES
11     echo 'Request: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:cwmp="urn:dslforum-org:cwmp-1-0">' >> $RES
12     echo ' <soap:Header/>' >> $RES
13     echo ' <soap:Body>' >> $RES
14     echo ' <SetVouchers>' >> $RES
15     echo ' <VoucherList>' >> $RES
16    
17     # add vouchers
18     for f in $VOUCHERS; do
19     openssl base64 -in $f -out $BASE64 -a
20     VOUCHER=`cat $BASE64 | tr -d '\n'`
21     printf " <xsd:base64>%s</xsd:base64>\n" $VOUCHER >> $RES
22     done
23    
24     # Close XML document
25     echo ' </VoucherList>' >> $RES
26     echo ' </SetVouchers>' >> $RES
27     echo ' </soap:Body>' >> $RES
28     echo ' </soap:Envelope>' >> $RES
29    

  ViewVC Help
Powered by ViewVC 1.1.26