our/cmds/timefor

7 lines
152 B
Bash
Executable File

#!/usr/bin/env bash
echo $2
ip=$(finger $1 | egrep -o -m 1 '([0-9]{1,3}\.){3}[0-9]{1,3}')
tz=$(curl -s "https://ipapi.co/$ip/timezone")
TZ=$tz date -R