if [[ $1 == "" ]]; then echo No dir specified exit 1 fi remove_shit() { grep -v 2025041600000003 | \ grep -v 2025041700000017 | \ grep -v FemaDeviceEmulat | \ grep -v FEMA_TEST_DEPLOY | \ grep -v FEMACLIENT_02 | \ grep -v 35JUZQY1rw2FIr3h | \ grep -v 1459559259125979 | \ grep -v 8502B557D56FB5C4 | \ grep -v hjaXtQ24Lh2RNwGV | \ grep -v FEMACLIENT_03 | \ grep -v T8yz7o6NEJ9RptU8 | \ grep -v ABCDEABCDEABCDEA | \ grep -v T8yz7o6NEJ9RptU8 | \ grep -v 2025062090000008 | \ grep -v 2025042190000007 } get_serials() { find -maxdepth 1 -type f | \ remove_shit | \ sort } hash() { cat $1 | \ grep -v REG_NUMBER | \ grep -v GOS_NUMBER | \ grep -v VIN | \ grep -v "\"GROUP\"" | \ shasum -a 1 | \ cut -c1-8 } format_hash() { echo $1 | \ sed 's/d4ae9b2a/AL1 prisoner/' | \ sed 's/d779ff9c/AL1 prisoner/' | \ sed 's/c940e51e/spb sinara - OK/' | \ sed 's/8ff42655/spb sinara - SHIT new ports, no sinara port set/' | \ sed 's/26c08847/spb sinara polygon - SHIT E-PKV/' | \ sed 's/6b8be672/spb sinara polygon - SHIT LEAKAGE and MDVR etc/' | \ sed 's/0002cb14/spb sinara polygon - SHIT WTF why there is MDVR/' | \ sed 's/cf279b97/ekb sinara - OK/' | \ sed 's/cd347055/ekb sinara - OK 1/' | \ sed 's/cf279b97/ekb sinara - SHIT E-PKV, ekb port 39445/' | \ sed 's/ce638624/ekb sinara - SHIT 1 E-PKV, ekb port 39445/' | \ sed 's/b55c04bc/ekb volgabus polygon - SHIT ips null/' | \ sed 's/3ffbb7aa/ekb volgabus polygon - SHIT ips null (other hosts order)/' | \ sed 's/fe450236/ekb volgabus - SHIT ips null, small sensor changes/' | \ sed 's/a4e5b9cc/ekb volgabus - SHIT ips null, better sensor names/' } get_reg() { cat $1 | grep REG_NUMBER | cut -d "\"" -f 4 } cd $1; get_serials | while read f; do h=$(hash $f) echo $f -- $h -- $(get_reg $f) -- $(format_hash $h) #echo $f -- $(hash $f) done # 26c08847 - 3005 ekb sinara - OK # cf279b97 - TL 254 spb sinara - OLD has E-PKV # 6b8be672 - 3017 spb sinara - OK polygon # c940e51e - 3010 spb sinara - OK # d4ae9b2a - 3014 spb sinara - OK polygon TEST i am not sure # b55c04bc - 3009ABT ekb volgab - SHIT ips null, polygon # 3ffbb7aa - 3007ABT ekb volgab - SHIT ips null, polygon (other hosts order) # 8ff42655 - 3002 spb sinara - SHIT new ports, now sinara port set # fe450236 - 3000ABT ekb volgab - SHIT ips null, small sensor changes # a4e5b9cc - 3011ABT