summaryrefslogtreecommitdiff
path: root/ioslay-firefox
diff options
context:
space:
mode:
Diffstat (limited to 'ioslay-firefox')
-rwxr-xr-xioslay-firefox46
1 files changed, 10 insertions, 36 deletions
diff --git a/ioslay-firefox b/ioslay-firefox
index fb382e0..5041260 100755
--- a/ioslay-firefox
+++ b/ioslay-firefox
@@ -69,40 +69,14 @@ iotop_reader()
69 done 69 done
70} 70}
71 71
72if [ "$UID" != 0 ] 72sudo_iotop()
73then 73{
74 sudo -- "$0" "$@" 74 if [ "$UID" = 0 ]
75 exit 75 then
76fi 76 command iotop "$@"
77 77 else
78while [ $# -gt 0 ] 78 sudo iotop "$@"
79do 79 fi
80 case "$1" in 80}
81 -q | --quiet )
82 exec 2>/dev/null
83 shift
84 ;;
85 -a | --all )
86 IOSLAY_KILL_ALL=y
87 shift
88 ;;
89 -- )
90 shift
91 break
92 ;;
93 -* )
94 exit 1
95 ;;
96 * )
97 break
98 ;;
99 esac
100done
101
102# if [ $# -gt 0 ]
103# then
104# echo "$0: Error: usage" >&2
105# exit 1
106# fi
107 81
108iotop -qq -b $(printf '\55\55pid=%s\n' "$@") | iotop_reader 82sudo_iotop -qq -b $(printf '\55\55pid=%s\n' "$@") | iotop_reader