From 717d52f88f8ea6b810247a623575a9d81b55592a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 18 Jun 2020 14:56:15 -0400 Subject: setting up joeyconfig after merge --- config.hs | 2 +- privdata/relocate | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 privdata/relocate diff --git a/config.hs b/config.hs index ec313725..97d90636 120000 --- a/config.hs +++ b/config.hs @@ -1 +1 @@ -config-simple.hs \ No newline at end of file +joeyconfig.hs \ No newline at end of file diff --git a/privdata/relocate b/privdata/relocate new file mode 100644 index 00000000..271692d8 --- /dev/null +++ b/privdata/relocate @@ -0,0 +1 @@ +.joeyconfig -- cgit v1.2.3 -- cgit v1.2.3 From 5b08116d1baf330ba5d50e7431f432fa10d02d4f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 18 Jun 2020 14:56:51 -0400 Subject: todo --- doc/todo/cabal_new-build_cruft.mdwn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/todo/cabal_new-build_cruft.mdwn diff --git a/doc/todo/cabal_new-build_cruft.mdwn b/doc/todo/cabal_new-build_cruft.mdwn new file mode 100644 index 00000000..586e9fde --- /dev/null +++ b/doc/todo/cabal_new-build_cruft.mdwn @@ -0,0 +1,17 @@ +cabal new-build (now the default with recent cabal versions) stores stuff +in dist-newstyle, versioned by the ghc version and the package version. + +So, as propellor builds itself on a host over and over again, +and the host is upgraded and propellor is upgraded, dist-newstyle will +accumulate cruft used by old builds. + +cabal clean can remove it of course, but then it won't update the build +incrementally. + +What would be good is, a way to detect that the versioning has changed, +and only then run cabal clean. One way to do that, would be when updating +the propellor symlink to the cabal built binary, compare the old and new +binary location. If they're not the same, the versioning has changed, +and so cabal clean and re-build. --[[Joey]] + +(Note that stack probably has the same problem too.) -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 From 6cd5fe6c70e92ff43a675e3b77bfb4f138c3ee77 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Jun 2020 19:40:12 -0400 Subject: comment typo --- src/Propellor/Types/Dns.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Propellor/Types/Dns.hs b/src/Propellor/Types/Dns.hs index 30302a7d..e9902513 100644 --- a/src/Propellor/Types/Dns.hs +++ b/src/Propellor/Types/Dns.hs @@ -181,7 +181,7 @@ newtype NamedConfMap = NamedConfMap (M.Map Domain NamedConf) instance IsInfo NamedConfMap where propagateInfo _ = PropagateInfo False --- | Adding a Master NamedConf stanza for a particulr domain always +-- | Adding a Master NamedConf stanza for a particular domain always -- overrides an existing Secondary stanza for that domain, while a -- Secondary stanza is only added when there is no existing Master stanza. instance Sem.Semigroup NamedConfMap where -- cgit v1.2.3 From 70e503e724c3c8cb4312cd128535afc1e06c84a8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 Jul 2020 10:28:20 -0400 Subject: be robust against hub location id changes --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 42 ++++++++++++++++++------ 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 9b8a7e70..5e80e130 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -1238,33 +1238,46 @@ homeNAS = propertyList "home NAS" $ props [ "# let users power control startech hub with uhubctl" , "ATTR{idVendor}==\"" ++ hubvendor ++ "\", ATTR{idProduct}==\"005a\", MODE=\"0666\"" ] - & autoMountDrivePort "archive-10" (USBHubPort hubvendor hubloc 1) + & autoMountDrivePort "archive-10" + (USBHubPort hubvendor 1) + (USBDriveId wd "1230") (Just "archive-oldest") - & autoMountDrivePort "archive-11" (USBHubPort hubvendor hubloc 2) + & autoMountDrivePort "archive-11" + (USBHubPort hubvendor 2) + (USBDriveId wd "25ee") (Just "archive-older") - & autoMountDrivePort "archive-12" (USBHubPort hubvendor hubloc 3) + & autoMountDrivePort "archive-12" + (USBHubPort hubvendor 3) + (USBDriveId seagate "3322") (Just "archive-old") - & autoMountDrivePort "archive-13" (USBHubPort hubvendor hubloc 4) + & autoMountDrivePort "archive-13" + (USBHubPort hubvendor 4) + (USBDriveId wd "25a3") (Just "archive") & autoMountDrive "passport" Nothing & Apt.installed ["git-annex", "borgbackup"] where hubvendor = "0409" - hubloc = "4-1.6" + wd = "1058" + seagate = "0bc2" data USBHubPort = USBHubPort { hubVendor :: String - , hubLocation :: String , hubPort :: Int } +data USBDriveId = USBDriveId + { driveVendorId :: String + , driveProductId :: String + } + -- Makes a USB drive with the given label automount, and unmount after idle -- for a while. -- -- The hub port is turned on and off automatically as needed, using -- uhubctl. -autoMountDrivePort :: Mount.Label -> USBHubPort -> Maybe FilePath -> Property DebianLike -autoMountDrivePort label hp malias = propertyList desc $ props +autoMountDrivePort :: Mount.Label -> USBHubPort -> USBDriveId -> Maybe FilePath -> Property DebianLike +autoMountDrivePort label hp drive malias = propertyList desc $ props & File.hasContent ("/etc/systemd/system/" ++ hub) [ "[Unit]" , "Description=Startech usb hub port " ++ show (hubPort hp) @@ -1272,7 +1285,7 @@ autoMountDrivePort label hp malias = propertyList desc $ props , "[Service]" , "Type=oneshot" , "RemainAfterExit=true" - , "ExecStart=/usr/sbin/uhubctl -a on " ++ selecthubport + , "ExecStart=/bin/sh -c 'uhubctl -a on " ++ selecthubport ++ "'" , "ExecStop=/bin/sh -c 'uhubctl -a off " ++ selecthubport -- Powering off the port does not remove device -- files, so ask udev to remove the devfile; it will @@ -1300,7 +1313,16 @@ autoMountDrivePort label hp malias = propertyList desc $ props selecthubport = unwords [ "-p", show (hubPort hp) , "-n", hubVendor hp - , "-l", hubLocation hp + , "-l", concat + -- The hub's location id, eg "1-1.4", does not seem + -- as stable as uhubctl claims it will be, + -- and the vendor is not sufficient since I have 2 + -- hubs from the same vendor. So search for the + -- drive in its output to determine it. + [ "$(uhubctl | awk -F '[: ]' '/Current status for hub/{u=$5}/" + , driveVendorId drive ++ ":" ++ driveProductId drive + , "/{print u})" + ] ] -- Makes a USB drive with the given label automount, and unmount after idle -- cgit v1.2.3 -- cgit v1.2.3 From 409da579296e8b3e5959231396c99bb6ab5d2ec4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 Jul 2020 10:46:57 -0400 Subject: fix shell quoting --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 5e80e130..9d0948a0 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -1285,8 +1285,8 @@ autoMountDrivePort label hp drive malias = propertyList desc $ props , "[Service]" , "Type=oneshot" , "RemainAfterExit=true" - , "ExecStart=/bin/sh -c 'uhubctl -a on " ++ selecthubport ++ "'" - , "ExecStop=/bin/sh -c 'uhubctl -a off " ++ selecthubport + , "ExecStart=/bin/sh -c \"uhubctl -a on " ++ selecthubport ++ "\"" + , "ExecStop=/bin/sh -c \"uhubctl -a off " ++ selecthubport -- Powering off the port does not remove device -- files, so ask udev to remove the devfile; it will -- be added back after the drive next spins up @@ -1294,7 +1294,7 @@ autoMountDrivePort label hp drive malias = propertyList desc $ props -- spun up. -- (This only works when the devfile is in -- by-label.) - ++ "; udevadm trigger --action=remove " ++ devfile ++ " || true'" + ++ "; udevadm trigger --action=remove " ++ devfile ++ " || true\"" , "[Install]" , "WantedBy=" ] @@ -1321,7 +1321,7 @@ autoMountDrivePort label hp drive malias = propertyList desc $ props -- drive in its output to determine it. [ "$(uhubctl | awk -F '[: ]' '/Current status for hub/{u=$5}/" , driveVendorId drive ++ ":" ++ driveProductId drive - , "/{print u})" + , "/{print u})'" ] ] -- cgit v1.2.3 -- cgit v1.2.3 From 951c833873f99f469133a1cfed38c21e2923bd9b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 Jul 2020 11:07:02 -0400 Subject: more fixquoting --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 9d0948a0..e7bcaa1b 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -1285,8 +1285,8 @@ autoMountDrivePort label hp drive malias = propertyList desc $ props , "[Service]" , "Type=oneshot" , "RemainAfterExit=true" - , "ExecStart=/bin/sh -c \"uhubctl -a on " ++ selecthubport ++ "\"" - , "ExecStop=/bin/sh -c \"uhubctl -a off " ++ selecthubport + , "ExecStart=/bin/sh -c 'uhubctl -a on " ++ selecthubport ++ "'" + , "ExecStop=/bin/sh -c 'uhubctl -a off " ++ selecthubport -- Powering off the port does not remove device -- files, so ask udev to remove the devfile; it will -- be added back after the drive next spins up @@ -1294,7 +1294,7 @@ autoMountDrivePort label hp drive malias = propertyList desc $ props -- spun up. -- (This only works when the devfile is in -- by-label.) - ++ "; udevadm trigger --action=remove " ++ devfile ++ " || true\"" + ++ "; udevadm trigger --action=remove " ++ devfile ++ " || true'" , "[Install]" , "WantedBy=" ] @@ -1319,9 +1319,9 @@ autoMountDrivePort label hp drive malias = propertyList desc $ props -- and the vendor is not sufficient since I have 2 -- hubs from the same vendor. So search for the -- drive in its output to determine it. - [ "$(uhubctl | awk -F '[: ]' '/Current status for hub/{u=$5}/" + [ "$(uhubctl | awk -F '[: ]' '/Current status for hub/{u=\\\\$5}/" , driveVendorId drive ++ ":" ++ driveProductId drive - , "/{print u})'" + , "/{print u}')" ] ] -- cgit v1.2.3 -- cgit v1.2.3 From f3f134e1c4bc6d264cf95ca7bbfcdd045b353d9d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 Jul 2020 11:19:33 -0400 Subject: one more --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index e7bcaa1b..519fdf2c 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -1319,9 +1319,9 @@ autoMountDrivePort label hp drive malias = propertyList desc $ props -- and the vendor is not sufficient since I have 2 -- hubs from the same vendor. So search for the -- drive in its output to determine it. - [ "$(uhubctl | awk -F '[: ]' '/Current status for hub/{u=\\\\$5}/" + [ "$(uhubctl | awk -F \"[: ]\" \"/Current status for hub/{u=\\\\$5}/" , driveVendorId drive ++ ":" ++ driveProductId drive - , "/{print u}')" + , "/{print u}\")" ] ] -- cgit v1.2.3 -- cgit v1.2.3 From 000c19b427737a6b39d2204ae1cd6fda1d2bc63b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 Jul 2020 12:13:42 -0400 Subject: Revert "be robust against hub location id changes" This reverts commit 70e503e724c3c8cb4312cd128535afc1e06c84a8. Bad approach because the device vendor and id are not visible when the port is turned off. --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 42 ++++++------------------ 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 519fdf2c..9b8a7e70 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -1238,46 +1238,33 @@ homeNAS = propertyList "home NAS" $ props [ "# let users power control startech hub with uhubctl" , "ATTR{idVendor}==\"" ++ hubvendor ++ "\", ATTR{idProduct}==\"005a\", MODE=\"0666\"" ] - & autoMountDrivePort "archive-10" - (USBHubPort hubvendor 1) - (USBDriveId wd "1230") + & autoMountDrivePort "archive-10" (USBHubPort hubvendor hubloc 1) (Just "archive-oldest") - & autoMountDrivePort "archive-11" - (USBHubPort hubvendor 2) - (USBDriveId wd "25ee") + & autoMountDrivePort "archive-11" (USBHubPort hubvendor hubloc 2) (Just "archive-older") - & autoMountDrivePort "archive-12" - (USBHubPort hubvendor 3) - (USBDriveId seagate "3322") + & autoMountDrivePort "archive-12" (USBHubPort hubvendor hubloc 3) (Just "archive-old") - & autoMountDrivePort "archive-13" - (USBHubPort hubvendor 4) - (USBDriveId wd "25a3") + & autoMountDrivePort "archive-13" (USBHubPort hubvendor hubloc 4) (Just "archive") & autoMountDrive "passport" Nothing & Apt.installed ["git-annex", "borgbackup"] where hubvendor = "0409" - wd = "1058" - seagate = "0bc2" + hubloc = "4-1.6" data USBHubPort = USBHubPort { hubVendor :: String + , hubLocation :: String , hubPort :: Int } -data USBDriveId = USBDriveId - { driveVendorId :: String - , driveProductId :: String - } - -- Makes a USB drive with the given label automount, and unmount after idle -- for a while. -- -- The hub port is turned on and off automatically as needed, using -- uhubctl. -autoMountDrivePort :: Mount.Label -> USBHubPort -> USBDriveId -> Maybe FilePath -> Property DebianLike -autoMountDrivePort label hp drive malias = propertyList desc $ props +autoMountDrivePort :: Mount.Label -> USBHubPort -> Maybe FilePath -> Property DebianLike +autoMountDrivePort label hp malias = propertyList desc $ props & File.hasContent ("/etc/systemd/system/" ++ hub) [ "[Unit]" , "Description=Startech usb hub port " ++ show (hubPort hp) @@ -1285,7 +1272,7 @@ autoMountDrivePort label hp drive malias = propertyList desc $ props , "[Service]" , "Type=oneshot" , "RemainAfterExit=true" - , "ExecStart=/bin/sh -c 'uhubctl -a on " ++ selecthubport ++ "'" + , "ExecStart=/usr/sbin/uhubctl -a on " ++ selecthubport , "ExecStop=/bin/sh -c 'uhubctl -a off " ++ selecthubport -- Powering off the port does not remove device -- files, so ask udev to remove the devfile; it will @@ -1313,16 +1300,7 @@ autoMountDrivePort label hp drive malias = propertyList desc $ props selecthubport = unwords [ "-p", show (hubPort hp) , "-n", hubVendor hp - , "-l", concat - -- The hub's location id, eg "1-1.4", does not seem - -- as stable as uhubctl claims it will be, - -- and the vendor is not sufficient since I have 2 - -- hubs from the same vendor. So search for the - -- drive in its output to determine it. - [ "$(uhubctl | awk -F \"[: ]\" \"/Current status for hub/{u=\\\\$5}/" - , driveVendorId drive ++ ":" ++ driveProductId drive - , "/{print u}\")" - ] + , "-l", hubLocation hp ] -- Makes a USB drive with the given label automount, and unmount after idle -- cgit v1.2.3 From 07a51fa6aad36fd78dc77ab343f46fc0a8764264 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 Jul 2020 12:35:36 -0400 Subject: better approach for finding hub port that works when port is powered off --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 44 ++++++++++++++++++------ 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 9b8a7e70..0abd1899 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -1238,33 +1238,46 @@ homeNAS = propertyList "home NAS" $ props [ "# let users power control startech hub with uhubctl" , "ATTR{idVendor}==\"" ++ hubvendor ++ "\", ATTR{idProduct}==\"005a\", MODE=\"0666\"" ] - & autoMountDrivePort "archive-10" (USBHubPort hubvendor hubloc 1) + & autoMountDrivePort "archive-10" + (USBHubPort hubvendor 1) + (USBDriveId wd "1230") (Just "archive-oldest") - & autoMountDrivePort "archive-11" (USBHubPort hubvendor hubloc 2) + & autoMountDrivePort "archive-11" + (USBHubPort hubvendor 2) + (USBDriveId wd "25ee") (Just "archive-older") - & autoMountDrivePort "archive-12" (USBHubPort hubvendor hubloc 3) + & autoMountDrivePort "archive-12" + (USBHubPort hubvendor 3) + (USBDriveId seagate "3322") (Just "archive-old") - & autoMountDrivePort "archive-13" (USBHubPort hubvendor hubloc 4) + & autoMountDrivePort "archive-13" + (USBHubPort hubvendor 4) + (USBDriveId wd "25a3") (Just "archive") & autoMountDrive "passport" Nothing & Apt.installed ["git-annex", "borgbackup"] where hubvendor = "0409" - hubloc = "4-1.6" + wd = "1058" + seagate = "0bc2" data USBHubPort = USBHubPort { hubVendor :: String - , hubLocation :: String , hubPort :: Int } +data USBDriveId = USBDriveId + { driveVendorId :: String + , driveProductId :: String + } + -- Makes a USB drive with the given label automount, and unmount after idle -- for a while. -- -- The hub port is turned on and off automatically as needed, using -- uhubctl. -autoMountDrivePort :: Mount.Label -> USBHubPort -> Maybe FilePath -> Property DebianLike -autoMountDrivePort label hp malias = propertyList desc $ props +autoMountDrivePort :: Mount.Label -> USBHubPort -> USBDriveId -> Maybe FilePath -> Property DebianLike +autoMountDrivePort label hp drive malias = propertyList desc $ props & File.hasContent ("/etc/systemd/system/" ++ hub) [ "[Unit]" , "Description=Startech usb hub port " ++ show (hubPort hp) @@ -1272,7 +1285,7 @@ autoMountDrivePort label hp malias = propertyList desc $ props , "[Service]" , "Type=oneshot" , "RemainAfterExit=true" - , "ExecStart=/usr/sbin/uhubctl -a on " ++ selecthubport + , "ExecStart=/bin/sh -c 'uhubctl -a on " ++ selecthubport ++ "'" , "ExecStop=/bin/sh -c 'uhubctl -a off " ++ selecthubport -- Powering off the port does not remove device -- files, so ask udev to remove the devfile; it will @@ -1300,7 +1313,18 @@ autoMountDrivePort label hp malias = propertyList desc $ props selecthubport = unwords [ "-p", show (hubPort hp) , "-n", hubVendor hp - , "-l", hubLocation hp + , "-l", concat + -- The hub's location id, eg "1-1.4", does not seem + -- as stable as uhubctl claims it will be, + -- and the vendor is not sufficient since I have 2 + -- hubs from the same vendor. So search for the + -- drive lsusb to find that. This works even if the + -- port is powered off, as long as it's been on at + -- some point before. + [ "$(lsusb -tvv | perl -lne \"if (m!/sys/bus/usb/devices/(.*?) !) {\\\\$v=$1}; if (/" + , driveVendorId drive ++ ":" ++ driveProductId drive + ++ "/) { print \\\\$v; last}\")" + ] ] -- Makes a USB drive with the given label automount, and unmount after idle -- cgit v1.2.3 -- cgit v1.2.3 From 53d0568ec0fec5a1472bb4f9417d957d9c3802ad Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 Jul 2020 13:37:21 -0400 Subject: more quoting --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 0abd1899..5c4bf569 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -1321,7 +1321,7 @@ autoMountDrivePort label hp drive malias = propertyList desc $ props -- drive lsusb to find that. This works even if the -- port is powered off, as long as it's been on at -- some point before. - [ "$(lsusb -tvv | perl -lne \"if (m!/sys/bus/usb/devices/(.*?) !) {\\\\$v=$1}; if (/" + [ "$(lsusb -tvv | perl -lne \"if (m!/sys/bus/usb/devices/(.*?) !) {\\\\$v=\\\\$1}; if (/" , driveVendorId drive ++ ":" ++ driveProductId drive ++ "/) { print \\\\$v; last}\")" ] -- cgit v1.2.3 -- cgit v1.2.3 From e1bbd9b1e5fb660f92103173e1fc6206c8158249 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 Jul 2020 14:09:31 -0400 Subject: improve horrible lstree parser --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 5c4bf569..64bee99d 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -1321,7 +1321,7 @@ autoMountDrivePort label hp drive malias = propertyList desc $ props -- drive lsusb to find that. This works even if the -- port is powered off, as long as it's been on at -- some point before. - [ "$(lsusb -tvv | perl -lne \"if (m!/sys/bus/usb/devices/(.*?) !) {\\\\$v=\\\\$1}; if (/" + [ "$(lsusb -tvv | perl -lne \"if (\\\\$h && m!/sys/bus/usb/devices/(.*?) !) {\\\\$v=\\\\$1}; if (m/Hub/) { \\\\$h=1 } else { \\\\$h=0 }; if (/" , driveVendorId drive ++ ":" ++ driveProductId drive ++ "/) { print \\\\$v; last}\")" ] -- cgit v1.2.3 -- cgit v1.2.3