X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=nodeinfo.sh;h=2ba294481e231ca6fe31c07c70c89837883072df;hb=bb4ad57f980850e1645fa23e6045a10adc22f617;hp=16baaee4dfffe1d7a31eccb8f6318b9c5ea4c8f0;hpb=da28cda496ffee4997b27bc5e3d3bf49c8cf0ee2;p=fba.git diff --git a/nodeinfo.sh b/nodeinfo.sh index 16baaee..2ba2944 100755 --- a/nodeinfo.sh +++ b/nodeinfo.sh @@ -1,66 +1,46 @@ #!/bin/sh MODE="" -DOMAINS="" +DOMAIN_LIST="" SOFTWARE_LIST="" if [ "$1" = "--help" ] then - echo "Usage: $0 [file|--software|--software2|--software3|--nodeinfo|--generator|--detection|--no-auto|--no-auto2|--timeout]" + echo "Usage: $0 [file|--software|--nodeinfo|--generator|--timeout|--same]" exit 255 elif [ -n "$1" -a -f "$1" ] then - DOMAINS=$(cat "$1") + DOMAIN_LIST=$(cat "$1") MODE="file" -elif [ "$1" = "--software" ] -then - DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE software IS NULL ORDER BY last_updated ASC;") - MODE="software" elif [ "$1" = "--nodeinfo" ] then - DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE software IS NULL AND nodeinfo_url IS NOT NULL ORDER BY last_updated ASC;") + DOMAIN_LIST=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE software IS NULL AND nodeinfo_url IS NOT NULL ORDER BY last_updated ASC;") MODE="nodeinfo" -elif [ "$1" = "--detection" ] -then - DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE detection_mode IS NULL ORDER BY last_updated ASC;") - MODE="detection" -elif [ "$1" = "--no-auto" ] -then - DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE detection_mode IS NOT NULL AND detection_mode != 'AUTO_DISCOVERY' ORDER BY last_updated ASC;") - MODE="noauto" -elif [ "$1" = "--no-auto2" ] -then - DOMAINS=`sqlite3 blocks.db "SELECT domain FROM instances WHERE software IN ('pleroma', 'mastodon', 'lemmy', 'friendica', 'misskey', 'peertube', 'takahe', 'gotosocial', 'brighteon', 'wildebeest', 'bookwyrm', 'mitra', 'areionskey', 'mammuthus') AND detection_mode != 'AUTO_DISCOVERY' ORDER BY last_updated ASC;"` - MODE="noauto2" elif [ "$1" = "--timeout" ] then - DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE last_error_details LIKE '%Timeout%' ORDER BY last_updated ASC;") - MODE="software" -elif [ "$1" = "--software2" ] -then - DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE software IS NOT NULL AND detection_mode IS NULL ORDER BY last_updated ASC;") - MODE="software2" -elif [ "$1" = "--software3" -a -f "software.txt" ] + DOMAIN_LIST=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE last_error_details LIKE '%Timeout%' ORDER BY last_updated ASC;") + MODE="timeout" +elif [ "$1" = "--software" -a -f "software.txt" ] then SOFTWARE_LIST=$(cat software.txt) - MODE="software3" + MODE="software" elif [ "$1" = "--generator" ] then - DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE detection_mode='GENERATOR' ORDER BY last_updated ASC;") + DOMAIN_LIST=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE detection_mode='GENERATOR' ORDER BY last_updated ASC;") MODE="generator" else - DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE software IS NULL AND nodeinfo_url IS NOT NULL ORDER BY last_updated ASC;") + DOMAIN_LIST=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE software IS NULL AND nodeinfo_url IS NOT NULL ORDER BY last_updated ASC;") fi -if [ -z "${DOMAINS}" -a -z "${SOFTWARE_LIST}" ] +if [ -z "${DOMAIN_LIST}" -a -z "${SOFTWARE_LIST}" ] then echo "$0: No domains or software found! MODE='${MODE}'" exit 255 fi -if [ -n "${DOMAINS}" ] +if [ -n "${DOMAIN_LIST}" ] then - for DOMAIN in ${DOMAINS}; + for DOMAIN in ${DOMAIN_LIST}; do echo "$0: DOMAIN='${DOMAIN}'" if [ -n "$1" -a -z "${MODE}" ]