Skip to content
Browse files

Add CUIT into file's name so more than one can be used per computer.

  • Loading branch information...
1 parent 9e937f3 commit 5c9f467ed49fbaedb48380798f5a739c2c7a2c71 @miloops committed Dec 22, 2011
Showing with 6 additions and 3 deletions.
  1. +2 −1 lib/bravo/auth_data.rb
  2. +4 −2 wsaa-client.sh
View
3 lib/bravo/auth_data.rb
@@ -13,10 +13,11 @@ def fetch
raise "Archivo certificado no encontrado en #{Bravo.cert}"
end
- todays_datafile = "/tmp/bravo_#{Time.new.in_time_zone('Buenos Aires').strftime('%d_%m_%Y')}.yml"
+ todays_datafile = "/tmp/bravo_#{Bravo.cuit}_#{Time.new.in_time_zone('Buenos Aires').strftime('%d_%m_%Y')}.yml"
opts = "-u #{Bravo.auth_url}"
opts += " -k #{Bravo.pkey}"
opts += " -c #{Bravo.cert}"
+ opts += " -i #{Bravo.cuit}"
unless File.exists?(todays_datafile)
%x(#{File.dirname(__FILE__)}/../../wsaa-client.sh #{opts})
View
6 wsaa-client.sh
@@ -132,7 +132,7 @@ EOF
function WriteYAML()
{
- cat <<EOF > /tmp/bravo_$(date +"%d_%m_%Y").yml
+ cat <<EOF > /tmp/bravo_${CUIT}_$(date +"%d_%m_%Y").yml
token: '$TOKEN'
sign: '$SIGN'
EOF
@@ -147,7 +147,7 @@ EOF
#[ $# -eq 0 ] && read -p "Service name: " SERVICE
# Parse commandline arguments
-while getopts 'k:u:c:' OPTION
+while getopts 'k:u:c:i:' OPTION
do
case $OPTION in
c) CRT=$OPTARG
@@ -156,6 +156,8 @@ do
;;
u) URL=$OPTARG
;;
+ i) CUIT=$OPTARG
+ ;;
esac
done
shift $(($OPTIND - 1))

0 comments on commit 5c9f467

Please sign in to comment.
Something went wrong with that request. Please try again.