Skip to content

Instantly share code, notes, and snippets.

@jordi-pascual
Created October 3, 2016 07:06
Show Gist options
  • Save jordi-pascual/5ef7a011e080aeefb6a41225327c76cb to your computer and use it in GitHub Desktop.
Save jordi-pascual/5ef7a011e080aeefb6a41225327c76cb to your computer and use it in GitHub Desktop.
Get DNI and CCC
#!/bin/bash
CURL='/usr/bin/curl'
RED='\033[0;31m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
# Get DNI
RVMHTTP="http://www.genware.es/xGenDoc.php"
CURLARGS="-f -s -S -k -X POST --data tipo=NIF"
DNI="$($CURL $CURLARGS $RVMHTTP | awk -F'|' '{print $2}')"
#Get CCC
RVMHTTP="http://www.genware.es/xGenCCC.php"
CURLARGS="-f -s -S -k -X POST"
CCC="$($CURL $CURLARGS $RVMHTTP | awk -F'|' '{print $2}' | tr -d '[[:space:]]')"
printf "\n\n"
printf "${GREEN}--------------------------------------${NC}\n"
printf "You DNI: ${RED}${DNI}${NC}\n"
printf "You CCC: ${YELLOW}${CCC}${NC}\n"
printf "${GREEN}--------------------------------------${NC}\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment