9 echo "Usage: $0 [file|--software|--software2|--software3|--nodeinfo|--generator|--detection|--no-auto|--no-auto2|--timeout]"
11 elif [ -n "$1" -a -f "$1" ]
15 elif [ "$1" = "--software" ]
17 DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE software IS NULL ORDER BY last_updated ASC;")
19 elif [ "$1" = "--nodeinfo" ]
21 DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE software IS NULL AND nodeinfo_url IS NOT NULL ORDER BY last_updated ASC;")
23 elif [ "$1" = "--detection" ]
25 DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE detection_mode IS NULL ORDER BY last_updated ASC;")
27 elif [ "$1" = "--no-auto" ]
29 DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE detection_mode IS NOT NULL AND detection_mode != 'AUTO_DISCOVERY' ORDER BY last_updated ASC;")
31 elif [ "$1" = "--no-auto2" ]
33 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;"`
35 elif [ "$1" = "--timeout" ]
37 DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE last_error_details LIKE '%Timeout%' ORDER BY last_updated ASC;")
39 elif [ "$1" = "--software2" ]
41 DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE software IS NOT NULL AND detection_mode IS NULL ORDER BY last_updated ASC;")
43 elif [ "$1" = "--software3" -a -f "software.txt" ]
45 SOFTWARE_LIST=$(cat software.txt)
47 elif [ "$1" = "--generator" ]
49 DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE detection_mode='GENERATOR' ORDER BY last_updated ASC;")
52 DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE software IS NULL AND nodeinfo_url IS NOT NULL ORDER BY last_updated ASC;")
55 if [ -z "${DOMAINS}" -a -z "${SOFTWARE_LIST}" ]
57 echo "$0: No domains or software found! MODE='${MODE}'"
61 if [ -n "${DOMAINS}" ]
63 for DOMAIN in ${DOMAINS};
65 echo "$0: DOMAIN='${DOMAIN}'"
66 if [ -n "$1" -a -z "${MODE}" ]
68 ./fba.py update_nodeinfo --domain=${DOMAIN} "$1"
71 ./fba.py update_nodeinfo --domain=${DOMAIN} "$2"
73 ./fba.py update_nodeinfo --domain=${DOMAIN}
76 elif [ -n "${SOFTWARE_LIST}" ]
78 for SOFTWARE in ${SOFTWARE_LIST};
80 echo "$0: SOFTWARE='${SOFTWARE}'"
83 ./fba.py update_nodeinfo --software=${SOFTWARE} "$2"
85 ./fba.py update_nodeinfo --software=${SOFTWARE}