Skip to content

Instantly share code, notes, and snippets.

@otobrglez
Created August 13, 2014 23:13
Show Gist options
  • Save otobrglez/b1b35bb0bda60cb63d24 to your computer and use it in GitHub Desktop.
Save otobrglez/b1b35bb0bda60cb63d24 to your computer and use it in GitHub Desktop.
Validating ZZZS number from command-line
#!/usr/bin/env bash
# 1. Make it executable 'chmod +x zzzs-validator.sh'
# 2. Use it './zzzs-validator.sh <ZZZV NUMBER>
HOST="https://zavarovanec.zzzs.si"
ANOY_SEC="/!ut/p/b1/lY_bboMwEES_JV_gtcHGeXQNKfcmITjBL4jeIhCBkkZI4evrRn1Ib6q60mq10hnNDNKoIBzsObcY2iHdVWO9r05131Xt-69ZySARfgDY50IyCOJcKU85AA4xQHEN3NmKGsCz3DBhGCT8U8_tUEBAWUwdOicA-C_9Fu3ALrOGvyTn0y6e5LhpptX51WzSyCl1JU7T5fJRrfMbIW-TY0dQiPS-7e9NvS3Snw1-yP8lwfeAFwB-GQEo9fvDEyoM5lwZycg0sSDHVEpsDtp8NGHDMNRHEnGcZrWVNVMmxYgf1qAWIiIFKfkMHXS7iGnoPbur2RveW3Gk/dl4/d5/L0lDU0lKSmdwcG1BIS9JTFNBQ0lpTXlDb2tBRUFtaWdiaVFDQUEvNEczYUQyZ2p2eWhEVXdnIS9aN182ME1BSEkwMUhPQ0s2MEkzMFUxNUNDMTBVMS8wLzI2OTIyMDY5MzkzOQ!!/"
ENDPOINT_URL="${HOST}/wps/portal/portali/azos/status_zavarovanja${ANOY_SEC}"
curl -si -X POST \
--data "zzzsNumber=$1" \
$ENDPOINT_URL \
2>/dev/null | grep -Fq "je urejeno."
if [ $? -eq 0 ]; then
echo "UREJENO"
else
echo "FAIL"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment