Skip to content

Commit

Permalink
Merge pull request #280 from zebrunner/udid-dash
Browse files Browse the repository at this point in the history
Udid dash fix
  • Loading branch information
vdelendik authored Nov 30, 2023
2 parents af9d00f + 583e487 commit 4e08165
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions roles/devices/templates/90_mcloud.rules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% for device in devices %}
SUBSYSTEM=="usb", ENV{ID_SERIAL_SHORT}=="{{ device.id | replace('-','') }}", MODE="0666", SYMLINK+="device-{{ device.name }}-{{ device.id }}"
ACTION=="remove", ENV{ID_SERIAL_SHORT}=="{{ device.id | replace('-','') }}", RUN+="/usr/local/bin/zebrunner-farm"
ACTION=="add", ENV{ID_SERIAL_SHORT}=="{{ device.id | replace('-','') }}", RUN+="/usr/local/bin/zebrunner-farm"
ACTION=="remove", ENV{ID_SERIAL_SHORT}=="{{ device.id | replace('-','') }}", RUN+="/usr/local/bin/zebrunner-farm remove {{ device.id }}"
ACTION=="add", ENV{ID_SERIAL_SHORT}=="{{ device.id | replace('-','') }}", RUN+="/usr/local/bin/zebrunner-farm add {{ device.id }}"
{% endfor %}
8 changes: 4 additions & 4 deletions roles/devices/templates/zebrunner-farm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [ ! -z $ACTION ]; then
# triggered by udev rule where device serial (udid) is a must to proceed!
if [ -z $ID_SERIAL_SHORT ]; then
if [ -z $2 ]; then
echo "do nothing as device id/udid missed."
exit 0
fi
Expand Down Expand Up @@ -507,14 +507,14 @@ case "$ACTION" in
add)
# #122 on start obligatory re-created any existing exited containers
# add action means physical connect via usb and as result we have to remove any existing container for device!
down ${ID_SERIAL_SHORT}
start ${ID_SERIAL_SHORT}
down $2
start $2
;;
bind)
echo "do nothing"
;;
remove)
down ${ID_SERIAL_SHORT}
down $2
;;
start)
start $2
Expand Down
8 changes: 4 additions & 4 deletions roles/mac-devices/templates/zebrunner-farm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export DOCKER_DEFAULT_PLATFORM=linux/amd64

if [ ! -z $ACTION ]; then
# triggered by udev rule where device serial (udid) is a must to proceed!
if [ -z $ID_SERIAL_SHORT ]; then
if [ -z $2 ]; then
echo "do nothing as device id/udid missed."
exit 0
fi
Expand Down Expand Up @@ -498,14 +498,14 @@ case "$ACTION" in
add)
# #122 on start obligatory re-created any existing exited containers
# add action means physical connect via usb and as result we have to remove any existing container for device!
down ${ID_SERIAL_SHORT}
start ${ID_SERIAL_SHORT}
down $2
start $2
;;
bind)
echo "do nothing"
;;
remove)
down ${ID_SERIAL_SHORT}
down $2
;;
start)
start $2
Expand Down

0 comments on commit 4e08165

Please sign in to comment.