diff --git a/src/fshaper/fshaper.sh b/src/fshaper/fshaper.sh index cd2bf79bf..16a2485bf 100755 --- a/src/fshaper/fshaper.sh +++ b/src/fshaper/fshaper.sh @@ -3,13 +3,9 @@ # Copyright (C) 2014-2024 Firejail Authors # License GPL v2 -TCFILE="" -if [ -x "/usr/sbin/tc" ]; then - TCFILE="/usr/sbin/tc" -elif [ -x "/sbin/tc" ]; then - TCFILE="/sbin/tc"; -else - echo "Error: traffic control utility (tc) not found"; +TCFILE="$(PATH=/usr/sbin:/sbin:/run/current-system/sw/bin command -v tc)" +if [ -z "$TCFILE" ]; then + echo "Error: traffic control utility (tc) not found" exit 1 fi