Skip to content

Instantly share code, notes, and snippets.

@WProbot
Last active December 11, 2021 14:44
Show Gist options
  • Select an option

  • Save WProbot/8edee562d493149f7b85eed9fc381f64 to your computer and use it in GitHub Desktop.

Select an option

Save WProbot/8edee562d493149f7b85eed9fc381f64 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# ide kerül => /etc/cron.weekly/callsign-weekly
#
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
OD=/netpub/wwwroot/breko.hu/callsign
OF=call_sign_book.csv
mkdir -p $OD
curl -s https://nmhh.hu/amator/call_sign_book.xml | gawk '
/<Row>/ {
for(q=0; 14 > q; q++) {
getline;
gsub("<[^>]*>", "");
printf "\"%s\",", $0;
}
getline;
gsub("<[^>]*>", "");
printf "\"%s\"\n", $0;
}
' | iconv -f iso-8859-2 -t utf8 > $OD/$OF
chown balint:balint $OD
chown balint:balint $OD/$OF
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment