Skip to content

Commit

Permalink
readd systemd grep for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Oct 5, 2023
1 parent 9d5eace commit 902823f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions machineid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ def id(winregistry: bool = True) -> str:
mountinfo = __read__('/proc/self/mountinfo')
if mountinfo:
if 'docker' in mountinfo:
id = __exec__("grep '/data/docker/containers' /proc/self/mountinfo | cut -d/ -f5")
id = __exec__("grep '/var/lib/docker/containers' /proc/self/mountinfo | cut -d/ -f6")
if not id:
id = __exec__("grep '/var/lib/docker/containers' /proc/self/mountinfo | cut -d/ -f6")
id = __exec__("grep '/data/docker/containers' /proc/self/mountinfo | cut -d/ -f5")
if not id:
id = __exec__("grep 'systemd' /proc/self/mountinfo | cut -d/ -f3")
if not id:
if 'microsoft' in uname().release: # wsl
id = __exec__("powershell.exe -ExecutionPolicy bypass -command '(Get-CimInstance -Class Win32_ComputerSystemProduct).UUID'")
Expand Down

0 comments on commit 902823f

Please sign in to comment.