📦➔🦋 Store and retrieve files on the Atmosphere
35
fork

Configure Feed

Select the types of activity you want to include in your feed.

info: fix/improve finger output

Ducky e49787b4 4ce18f2b

+28 -13
+28 -13
atfile.sh
··· 1370 1370 file_size="$(echo "$record" | jq -r '.value.file.size')" 1371 1371 file_size_pretty="$(atfile.util.get_file_size_pretty $file_size)" 1372 1372 1373 - finger="(None)" 1374 - finger_type="" 1373 + unset finger_type 1375 1374 header="$file_name_pretty" 1376 1375 1377 1376 if [[ $(atfile.util.is_null_or_empty "$file_hash_type") == 1 ]] || [[ "$file_hash_type" == "md5" && ${#file_hash} != 32 ]] || [[ "$file_hash_type" == "none" ]]; then ··· 1380 1379 1381 1380 if [[ "$(echo $record | jq -r ".value.finger")" != "null" ]]; then 1382 1381 finger_type="$(echo $record | jq -r ".value.finger.\"\$type\"" | cut -d "#" -f 2)" 1383 - finger="$(echo $record | jq -r ".value.finger.id")" 1384 1382 fi 1385 1383 1386 1384 echo "$header" ··· 1394 1392 echo -e " ↳ Hash: $file_hash_pretty" 1395 1393 echo -e "↳ Locked: $locked" 1396 1394 echo -e "↳ Encrypted: $encrypted" 1397 - echo -e "↳ Finger: $finger" 1398 - case $finger_type in 1399 - "browser") 1400 - echo -e " ↳ Hostname: $(echo $record | jq -r ".value.finger.userAgent")" 1401 - ;; 1402 - "machine") 1403 - echo -e " ↳ Hostname: $(echo $record | jq -r ".value.finger.host")" 1404 - echo -e " ↳ OS: $(echo $record | jq -r ".value.finger.os")" 1405 - ;; 1406 - esac 1395 + if [[ -z "$finger_type" ]]; then 1396 + echo -e "↳ Source: (Unknown)" 1397 + else 1398 + case $finger_type in 1399 + "browser") 1400 + finger_browser_uas="$(echo $record | jq -r ".value.finger.userAgent")" 1401 + 1402 + [[ -z $finger_browser_uas || $finger_browser_uas == "null" ]] && finger_browser_uas="(Unknown)" 1403 + 1404 + echo -e "↳ Source: $finger_browser_uas" 1405 + ;; 1406 + "machine") 1407 + finger_machine_app="$(echo $record | jq -r ".value.finger.app")" 1408 + finger_machine_host="$(echo $record | jq -r ".value.finger.host")" 1409 + finger_machine_os="$(echo $record | jq -r ".value.finger.os")" 1410 + 1411 + [[ -z $finger_machine_app || $finger_machine_app == "null" ]] && finger_machine_app="(Unknown)" 1412 + 1413 + echo -e "↳ Source: $finger_machine_app" 1414 + [[ -n $finger_machine_host && $finger_machine_host != "null" ]] && echo -e " ↳ Host: $finger_machine_host" 1415 + [[ -n $finger_machine_os && $finger_machine_os != "null" ]] && echo -e " ↳ OS: $finger_machine_os" 1416 + ;; 1417 + *) 1418 + echo -e "↳ Source: (Unknown)" 1419 + ;; 1420 + esac 1421 + fi 1407 1422 fi 1408 1423 else 1409 1424 atfile.die "Unable to get '$key'"