| 37 | | # Just in case a root user doesn't have /sbin in his/her path for some reason |
| 38 | | # (was seen once) |
| 39 | | $ENV{PATH} = '/sbin:'.$ENV{PATH} |
| 40 | | unless $ENV{PATH} =~ m,(^|:)/sbin/?(:|$),; |
| 41 | | # Same for /usr/local/sbin since we need i2cdetect which is installed there |
| 42 | | # by default (reported by Lennard Klein) |
| 43 | | $ENV{PATH} = '/usr/local/sbin:'.$ENV{PATH} |
| 44 | | unless $ENV{PATH} =~ m,(^|:)/usr/local/sbin/?(:|$),; |
| | 37 | # We will call modprobe and i2cdetect, which typically live in either /sbin, |
| | 38 | # /usr/sbin or /usr/local/bin. So make sure these are all in the PATH. |
| | 39 | foreach ('/usr/sbin', '/usr/local/sbin', '/sbin') { |
| | 40 | $ENV{PATH} = "$_:".$ENV{PATH} |
| | 41 | unless $ENV{PATH} =~ m/(^|:)$_\/?(:|$)/; |
| | 42 | } |