# Version 2025-07-25a

if [ "$1" = "where" ]; then
  echo heartbeat|sudo tee /sys/class/leds/led0/trigger > /dev/null
fi
# Serial           # Name  # Longname                   # Roll          # Disp  # Pins # Plats         # Förklaring
# 00000000ba65afcc # PI-41 # BSTAN-BLACK-OFFICE		# default	# yes	# yes  # Kontoret      # Temp kontoret
# 0000000027a7801e # PI-42 # BPLUS-BLACK-ATDESK		# default	# yes	# yes  # 6_5_desk	# Temp balkong/vardagsrum
# 000000006804e497 # PI-43 # BPLUS-BLACK-ROUND		# default	# yes	# yes  # Balkongdorr	# Kallluft/inluft
# 000000006a8294ac # PI-44 # BPLUS-WHITE-LABRAT		# default	# yes	# yes  # Desk		# Unreliable
# 0000000023a0d823 # PI-45 # APLUS-BLACK-LABRAT		# default	# yes	# yes  # Kontoret	# Inget
# 000000002d069c23 # PI-46 # APLUS-NAKED-LABRAT		# trasig	# yes	# yes  # ---		# Trasig
# 00000000e517efd8 # PI-47 # BPLUS-BLACK-WEBDATA	# default	# yes	# yes  # Zarniwoop usb # Webdata
# 0000000049e30715 # PI-48 # BPLUS-WHITE		# bme		# yes	# yes  # TVn		# bme
# 00000000276d30f8 # PI-49 # 2B-BLACK			# default	# yes	# yes  # Sundbyberg	# Inget
# 0000000008a0da03 # PI-50 # 2B-CLEAR			# default	# yes	# yes  # Lager		# X
# 00000000c2146da0 # PI-51 # 3B-WHITE-eInk		# default	# yes	# yes  # Erpato desk	# e-Ink stor
# 000000003e525aa9 # PI-52 # 3B-BLACK-SERVER		# default	# yes	# yes  # Serverrum	# temp
# 00000000574f5280 # PI-53 # Z-NAKED			# default	# yes	# no   # Kontoret	# Test
# 00000000786dddcd # PI-54 # ZW-BLACK-PINS		# default	# no	# yes  # Kitchen	# Temp kyl/frys
# 0000000029e066e7 # PI-55 # ZW-BLACK-PINS		# default	# text	# yes  # Sangen	# Temp i sangen
# 00000000e37f49b4 # PI-56 # ZW-BLACK			# default	# text	# no   # Skrivbord	# Test
# 0000000074159ace # PI-57 # ZW-3D-BLACK-PINS-lid	# default	# text	# yes  # Desk		# Temp balkong
# 0000000080b80cc9 # PI-58 # ZW-3D-WHITE		# default	# text	# no   # ppm		# ppm
# 00000000b3211613 # PI-59 # ZW-3D-BLACK-PINS-lid	# default	# text	# yes  # 3d-printer	# dht
# 000000000c9e0866 # PI-60 # ZW-3D-BLACK-PINS-lid	# default	# text	# yes  # Hemma  	# Säng-temp
# 00000000cbb3a60c # PI-61 # ZW-BLUE-PINS		# default	# yes	# yes  # Thrashbarg	# -
# 00000000c88bfe19 # PI-62 # Z-NAKED			# default	# yes	# no   # Hemma		# -
# 00000000cc013197 # PI-63 # 3APLUS-BLACK		# reinstall	# yes	# yes  # Hemma		# -
# 100000007401be0b # PI-64 # 4B-ALU			# desktop	# yes	# yes  # Erpato Monitor # Skrivbord
# 10000000b2c66a59 # PI-65 # 4B-Black			# PPM		# yes	# yes  # PPM		# ppm
# 000000000b75bb24 # PI-66 # ZW2			# default	# text	# no   # Jobbet	# Test
# 00000000f61a7617 # PI-67 # ZW2			# default	# text	# no   # Jobbet	# Test
# 00000000a52605fd # PI-68 # ZW2			# default	# text	# yes   # Jobbet	# Test
# 000000005c664005 # PI-69 # ZW2			# default	# text	# no   # Jobbet	# Test
# d26d711580d2cd85 # PI-70 # 5B				# default	# text	# yes  # Hemma		# Test
# 000000008b432ef8 # PI-71 # ZW2			# PPM		# text	# no   # Hemma		# DHT
# 00000000ff7b153f # PI-72 # ZW2			# default	# text	# no   # Hemma		# Inget
# 00000000a1d9f37b # PI-73 # ZW2-PINS			# default	# text	# yes  # Hemma		# Inget
# ceaffa50df3420b8 # PI-74 # 5B				# default	# text	# yes  # Hemma		# Test












DEV=$(cat /proc/cpuinfo |grep Serial|awk '{print $3}')
if [ "$1" = "DESC" ]; then
  TXT=$(head -n 50 /home/pi/temp/whoami.sh|grep $DEV|awk -F '#' '{print $4}')
elif [ "$1" = "ROLE" ]; then
  TXT=$(head -n 50 /home/pi/temp/whoami.sh|grep $DEV|awk -F '#' '{print $5}')
elif [ "$1" = "PLACE" ]; then
  TXT=$(head -n 50 /home/pi/temp/whoami.sh|grep $DEV|awk -F '#' '{print $8}')
elif [ "$1" = "DISPLAY" ]; then
  TXT=$(head -n 50 /home/pi/temp/whoami.sh|grep $DEV|awk -F '#' '{print $6}')
elif [ "$1" = "PINS" ]; then
  TXT=$(head -n 50 /home/pi/temp/whoami.sh|grep $DEV|awk -F '#' '{print $7}')
elif [ "$1" = "COMMENT" ]; then
  TXT=$(head -n 50 /home/pi/temp/whoami.sh|grep $DEV|awk -F '#' '{print $9}')
elif [ "$1" = "SERIAL" ]; then
  TXT=$(head -n 50 /home/pi/temp/whoami.sh|grep $DEV|awk -F '#' '{print $2}')
else
  TXT=$(head -n 50 /home/pi/temp/whoami.sh|grep $DEV|awk -F '#' '{print $3}')
fi
echo $TXT
if [ "$1" = "where" ]; then
  sleep 1
  echo default-on|sudo tee /sys/class/leds/led0/trigger > /dev/null
fi
