-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements and cleanup #19
base: master
Are you sure you want to change the base?
Commits on Oct 24, 2018
-
gitignore: Ignore common editor backups
Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e1aa312 - Browse repository at this point
Copy the full SHA e1aa312View commit details -
The current file is mixing tabs and spaces on various indents. Since tabs are use the most, I suppose that's what was intended to be used. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5673854 - Browse repository at this point
Copy the full SHA 5673854View commit details -
Add .editorconfig editor configuration file
Ensure consistent editing where supported by adding the optional .editorconfig. This does not enforce any style and only works if the editor supports it (via a plugin for example). Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a6781cd - Browse repository at this point
Copy the full SHA a6781cdView commit details -
By putting udevadm in a variable we only have one place to have the whole string, could easily replace it with UDEVADM="$(command -v udevadm)" or otherwise. Furthermore add a test for the executability of the binary. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6a2bab3 - Browse repository at this point
Copy the full SHA 6a2bab3View commit details -
Depend on systemd (for udevadm/systemd-escape)
As udevadm, systemd-escape and the various service files are hard requirement, list it as explicitly so in the debian control file. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ea3c64e - Browse repository at this point
Copy the full SHA ea3c64eView commit details -
According to the udevadm manual page --export produces a parseable list. -x, --export Print output as key/value pairs. Values are enclosed in single quotes. So using grep to drop lines that are not key/value pairs is just a resource waste without doing anything. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d485c2f - Browse repository at this point
Copy the full SHA d485c2fView commit details -
By putting blkid in a variable we only have one place to have the whole string, could easily replace it with BLKID="$(command -v blkid)" or otherwise. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0aa917f - Browse repository at this point
Copy the full SHA 0aa917fView commit details -
Depend on util-linux (for blkid)
The busybox variant of blkid does not work by default with usbmount. So ensure we depend on the real thing. Things not supported: -p gets ignored and 'USAGE' is not returned. -o value is not supported -s FIELD is ignored It basically just dumps the known info and that's that. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 728c0c0 - Browse repository at this point
Copy the full SHA 728c0c0View commit details -
Put the usbmount directories in variables
As with blkid, having the standard usbmount directories in variables makes use of these variables less error-prone on usage. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ec8ba84 - Browse repository at this point
Copy the full SHA ec8ba84View commit details -
Quote and use curly bracers around variables
Using quotes and curly braces around shell variables everywhere can be considered good programming practise andtends to be more consistent. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0a8b311 - Browse repository at this point
Copy the full SHA 0a8b311View commit details -
Remove legacy
..
backtick syntaxIt has a series of undefined behaviors related to quoting in POSIX. It imposes a custom escaping mode with surprising results. It's exceptionally hard to nest. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cb70ddb - Browse repository at this point
Copy the full SHA cb70ddbView commit details -
The blkid tool can output exactly what we need using various parameters. This saves us some sed headaches. The only 'downside' is we can't use our own names for the variables, which affects 'FSTYPE' so that was renamed (rather then do a FSTYPE=$TYPE). Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3f7548e - Browse repository at this point
Copy the full SHA 3f7548eView commit details -
Using egrep is considered deprecated and should be avoided and not used. While we could use grep -q -E, using two simple string comparissions avoid having to call an external tool, making the script lighter and cleaner. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 26c2565 - Browse repository at this point
Copy the full SHA 26c2565View commit details -
Replace depracted egrep with grep -E
Use grep -E when quering fstab to avoid the deprecated egrep. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a365b60 - Browse repository at this point
Copy the full SHA a365b60View commit details -
Use mountpoint instead of grep /proc/mounts
Parsing /proc/mounts by hand is not needed as we have the 'mountpoint' utility (part of util-linux and busybox). This eases some regex foo which improves readbility. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1fdd5da - Browse repository at this point
Copy the full SHA 1fdd5daView commit details -
While not strictly needed it is considered good practise to ensure proper exit at the end of the script. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3079c8e - Browse repository at this point
Copy the full SHA 3079c8eView commit details -
By default, read will interpret backslashes before spaces and line feeds, and otherwise strip them. This is rarely expected or desired. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ba72fed - Browse repository at this point
Copy the full SHA ba72fedView commit details -
The read utility reads multiple variables with a dummy variable called 'remainder'. Instead, use the more common and well recognized by checkers '_' (underscore) as a dummy variable. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a41da1c - Browse repository at this point
Copy the full SHA a41da1cView commit details -
Ensure grep is called with -E when using regex
When passing regex to grep, make this explicit with the -E parameter. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ffe4066 - Browse repository at this point
Copy the full SHA ffe4066View commit details -
Add sourced file helper for shellcheck
With usbmount now being shellcheck compliant, there is only one remaining warning, SC1091 about our sourced file. While we cannot scan whatever the user has installed, we can point shellcheck to the local default config instead. Note, that this will still produce a warning on shellcheck.net as it obviously still cannot access the file. Signed-off-by: Olliver Schinagl <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a54a2ee - Browse repository at this point
Copy the full SHA a54a2eeView commit details