]> git.mxchange.org Git - fba.git/blobdiff - nodeinfo.sh
Continued:
[fba.git] / nodeinfo.sh
index edb20856bdae2e1062ab11a49546838b5bfe1fd6..3ec3862fc7da60881e5a3f29e36ddb27b2f0e79f 100755 (executable)
@@ -6,53 +6,37 @@ 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")
        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;")
        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 != '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" ]
+       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;")
        MODE="generator"
+elif [ "$1" = "--same" ]
+then
+       DOMAINS=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE domain=software ORDER BY last_updated ASC;")
+       MODE="same"
 else
        DOMAINS=$(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}" and -z "${SOFTWARE_LIST}" ]
+if [ -z "${DOMAINS}" -a -z "${SOFTWARE_LIST}" ]
 then
        echo "$0: No domains or software found! MODE='${MODE}'"
        exit 255