Created
October 3, 2016 07:06
-
-
Save jordi-pascual/5ef7a011e080aeefb6a41225327c76cb to your computer and use it in GitHub Desktop.
Get DNI and CCC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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