Skip to content

Instantly share code, notes, and snippets.

@vadirajks
Created May 17, 2022 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vadirajks/3e9625ca9c3f9a967211d95d82dd8862 to your computer and use it in GitHub Desktop.
Save vadirajks/3e9625ca9c3f9a967211d95d82dd8862 to your computer and use it in GitHub Desktop.
whois workaround
1>
cat /custom-scripts/domain_expire.sh
#!/bin/bash
target=$1
expdate=$(whois $1 | grep -m1 -oPi '(expir.*date|expir.*on).*\s\K\d.+'.)
expdate=$(date -d"$expdate" +%s)
curdate=$(date +%s)
echo $(((expdate-curdate)/86400))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment