{"action":"created","issue":{"url":"https://api.github.com/repos/carlsonorozco/ejector/issues/2","repository_url":"https://api.github.com/repos/carlsonorozco/ejector","labels_url":"https://api.github.com/repos/carlsonorozco/ejector/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/carlsonorozco/ejector/issues/2/comments","events_url":"https://api.github.com/repos/carlsonorozco/ejector/issues/2/events","html_url":"https://github.com/carlsonorozco/ejector/issues/2","id":160002923,"number":2,"title":"Trying to add FireWire > works, but problems with combined USB+FW \"eject all physical\"","user":{"login":"JayBrown","id":477431,"avatar_url":"https://avatars.githubusercontent.com/u/477431?v=3","gravatar_id":"","url":"https://api.github.com/users/JayBrown","html_url":"https://github.com/JayBrown","followers_url":"https://api.github.com/users/JayBrown/followers","following_url":"https://api.github.com/users/JayBrown/following{/other_user}","gists_url":"https://api.github.com/users/JayBrown/gists{/gist_id}","starred_url":"https://api.github.com/users/JayBrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JayBrown/subscriptions","organizations_url":"https://api.github.com/users/JayBrown/orgs","repos_url":"https://api.github.com/users/JayBrown/repos","events_url":"https://api.github.com/users/JayBrown/events{/privacy}","received_events_url":"https://api.github.com/users/JayBrown/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-13T17:26:55Z","updated_at":"2016-06-14T01:45:08Z","closed_at":"2016-06-14T01:45:08Z","body":"I'm trying to tweak the ejector script to suit my needs, and I've added a FireWire option:\r\n\r\n```\r\ntotal_fw=0\r\n[[ $protocol = 'FireWire' ]] && ((total_fw++))\r\n[ $((total_fw)) -ge 2 ] && echo \"Eject All FireWire Volumes | bash=$0 param1=ejectall param2=fws terminal=false\"\r\nprotocol_type=\"${protocol_type/fws/FireWire}\"\r\n```\r\n\r\nThis works great.\r\n\r\nHowever, I now want to include all external volumes (FW & USB) in \"physical volumes\", therefore:\r\n\r\n```\r\ntotal_ext=0\r\n[[ $protocol = 'USB' ]] && ((total_usb++))\r\n[[ $protocol = 'USB' ]] && ((total_ext++))\r\n[[ $protocol = 'FireWire' ]] && ((total_fw++))\r\n[[ $protocol = 'FireWire' ]] && ((total_ext++))\r\n[ $((total_ext)) -ge 2 ] && echo \"Eject All Physical Volumes | bash=$0 param1=ejectall param2=exts terminal=false\"\r\n```\r\n\r\n$2 is a new one, namely exts for \"externals\", and this is where I'm hitting a dead end. I need to define `protocol_type` somehow to include both `USB` and `FireWire` in order to eject all USB and FireWire volumes, when clicking on \"Eject All Physical Volumes\". I tried this…\r\n`protocol_type=\"${protocol_type/exts/{FireWire,USB}}\"`\r\nplus\r\n`[[ \"${protocol_type}\" = \"$protocol\" ]] && ./\"$0\" eject \"$mount_point\"`\r\n…but that didn't work. Any hint?"},"comment":{"url":"https://api.github.com/repos/carlsonorozco/ejector/issues/comments/225758235","html_url":"https://github.com/carlsonorozco/ejector/issues/2#issuecomment-225758235","issue_url":"https://api.github.com/repos/carlsonorozco/ejector/issues/2","id":225758235,"user":{"login":"JayBrown","id":477431,"avatar_url":"https://avatars.githubusercontent.com/u/477431?v=3","gravatar_id":"","url":"https://api.github.com/users/JayBrown","html_url":"https://github.com/JayBrown","followers_url":"https://api.github.com/users/JayBrown/followers","following_url":"https://api.github.com/users/JayBrown/following{/other_user}","gists_url":"https://api.github.com/users/JayBrown/gists{/gist_id}","starred_url":"https://api.github.com/users/JayBrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JayBrown/subscriptions","organizations_url":"https://api.github.com/users/JayBrown/orgs","repos_url":"https://api.github.com/users/JayBrown/repos","events_url":"https://api.github.com/users/JayBrown/events{/privacy}","received_events_url":"https://api.github.com/users/JayBrown/received_events","type":"User","site_admin":false},"created_at":"2016-06-14T01:45:08Z","updated_at":"2016-06-14T01:45:08Z","body":"solved it myself: just define `USB@FireWire` for `exts`, and then add another `for x in y;do` with `IFS=@`"}}
{"actor":{"display_login":"JayBrown"}}