camera to dmesg

This commit is contained in:
paukstelis
2022-09-27 21:21:36 -04:00
parent 6036492cc5
commit ef5722dbe6

View File

@@ -187,7 +187,7 @@ new_instance () {
if prompt_confirm "Do you want to use the physical USB port to assign the udev entry? If you use this any USB hubs and printers detected this way must stay plugged into the same USB positions on your machine as they are right now"; then if prompt_confirm "Do you want to use the physical USB port to assign the udev entry? If you use this any USB hubs and printers detected this way must stay plugged into the same USB positions on your machine as they are right now"; then
echo echo
USB=$TEMPUSB USB=$TEMPUSB
echo -e "Your printer will be setup at the following usb address:\033[0;34m $USB\033[0m" | log echo -e "Your printer will be setup at the following usb address: $USB" | log
echo echo
else else
main_menu main_menu
@@ -379,13 +379,14 @@ add_camera() {
done done
fi fi
journalctl --rotate > /dev/null 2>&1 #journalctl --rotate > /dev/null 2>&1
journalctl --vacuum-time=1seconds > /dev/null 2>&1 #journalctl --vacuum-time=1seconds > /dev/null 2>&1
dmesg -C
echo "Plug your camera in via USB now (detection time-out in 1 min)" echo "Plug your camera in via USB now (detection time-out in 1 min)"
counter=0 counter=0
while [[ -z "$CAM" ]] && [[ $counter -lt 30 ]]; do while [[ -z "$CAM" ]] && [[ $counter -lt 30 ]]; do
CAM=$(timeout 1s journalctl -kf | sed -n -e 's/^.*SerialNumber: //p') CAM=$(timeout 1s dmesg -w | sed -n -e 's/^.*SerialNumber: //p')
TEMPUSBCAM=$(timeout 1s journalctl -kf | sed -n -e 's|^.*input:.*/\(.*\)/input/input.*|\1|p') TEMPUSBCAM=$(timeout 1s dmesg -w | sed -n -e 's|^.*input:.*/\(.*\)/input/input.*|\1|p')
counter=$(( $counter + 1 )) counter=$(( $counter + 1 ))
done done
#Failed state. Nothing detected #Failed state. Nothing detected