summaryrefslogtreecommitdiff
path: root/src/fireslay
diff options
context:
space:
mode:
Diffstat (limited to 'src/fireslay')
-rwxr-xr-xsrc/fireslay38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/fireslay b/src/fireslay
new file mode 100755
index 0000000..3c68ad5
--- /dev/null
+++ b/src/fireslay
@@ -0,0 +1,38 @@
1#!/bin/sh
2set -e
3. sliceweasel.lib.sh
4
5is_web_content()
6{
7 local comm state
8 read comm < /proc/"$1"/comm && [ "$comm" = 'Web Content' ] &&
9 read _ _ state _ < /proc/"$1"/stat && [ "$state" != Z ] || return
10}
11
12web_content_pids()
13{
14 while read pid
15 do
16 if is_web_content $pid
17 then
18 echo $pid
19 fi
20 done < $FIREFOX_GROUP_PROCS
21}
22
23FIREFOX_GROUP_PROCS=$(get_firefox_cgroup_procs)
24
25[ -e "$FIREFOX_GROUP_PROCS" ] || die "Firefox group not found ($FIREFOX_GROUP_PROCS)"
26
27set -- $(web_content_pids)
28
29if [ $# = 0 ]
30then
31 exit
32fi
33
34(
35 set -x
36 ps $* >&2
37 kill $*
38)