Fix quoting issues in bin/

This commit is contained in:
David Tomaschik
2025-09-03 14:52:33 -07:00
parent 61d00103bf
commit dea3f289c2
5 changed files with 11 additions and 7 deletions

View File

@@ -3,8 +3,12 @@
CHROME=`which google-chrome` CHROME=`which google-chrome`
if [ `id -u` != "0" ] ; then if [ `id -u` != "0" ] ; then
exec $CHROME "$@" exec "$CHROME" "$@"
fi fi
CMD="${CHROME} --user-data-dir=${HOME}/.chrome-data-dir \"$@\"" args=()
su -c "${CMD}" chromeuser for x in "$@"; do
args+=("$(printf %q "$x")")
done
su -c "$CHROME --user-data-dir=${HOME}/.chrome-data-dir ${args[*]}" chromeuser

View File

@@ -5,7 +5,7 @@ function list_nvidia_installed {
} }
function hold_or_unhold { function hold_or_unhold {
apt-mark "${1:-hold}" $(list_nvidia_installed) list_nvidia_installed | xargs apt-mark "${1:-hold}"
} }
case "$1" in case "$1" in

View File

@@ -37,7 +37,7 @@ function volume {
case "$1" in case "$1" in
mute|micmute|volume) mute|micmute|volume)
$* "$@"
;; ;;
*) *)
echo "Unknown command!" echo "Unknown command!"

View File

@@ -43,6 +43,6 @@ function get_bridge_ifaces {
bridge link | grep "master ${1}" | cut -d: -f2 | cut -d@ -f1 bridge link | grep "master ${1}" | cut -d: -f2 | cut -d@ -f1
} }
for iface in $(get_bridge_ifaces "${BRIDGE}") ; do get_bridge_ifaces "${BRIDGE}" | while IFS= read -r iface ; do
handle_iface "$iface" handle_iface "$iface"
done done

View File

@@ -7,7 +7,7 @@ fi
if [ `whoami` != "root" ] ; then if [ `whoami` != "root" ] ; then
if which sudo >/dev/null 2>&1 ; then if which sudo >/dev/null 2>&1 ; then
sudo $0 $* sudo "$0" "$@"
exit exit
fi fi
echo "Sorry, this requires root." >&2 echo "Sorry, this requires root." >&2