summaryrefslogtreecommitdiff
path: root/packages/cern-scripts/src/main/resources/bin/restart-gwt.sh
diff options
context:
space:
mode:
authorYves Fischer <yves.fischer@cern.ch>2016-01-15 19:27:34 +0100
committerYves Fischer <yves.fischer@cern.ch>2016-01-15 19:27:34 +0100
commit23c57ff24840c6f612ffd19effbac70a2c218865 (patch)
tree8d1360d385258599586bf3f9568d77ec8cdb6f92 /packages/cern-scripts/src/main/resources/bin/restart-gwt.sh
parent3b7cbbd6a5652b055aa680a1fc4dc1369079c78d (diff)
downloaddebian-packages-23c57ff24840c6f612ffd19effbac70a2c218865.tar.gz
debian-packages-23c57ff24840c6f612ffd19effbac70a2c218865.zip
cern-scripts: package
Diffstat (limited to 'packages/cern-scripts/src/main/resources/bin/restart-gwt.sh')
-rwxr-xr-xpackages/cern-scripts/src/main/resources/bin/restart-gwt.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/cern-scripts/src/main/resources/bin/restart-gwt.sh b/packages/cern-scripts/src/main/resources/bin/restart-gwt.sh
new file mode 100755
index 0000000..3870874
--- /dev/null
+++ b/packages/cern-scripts/src/main/resources/bin/restart-gwt.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -x
+pid=`jps | grep DevMode | cut -f 1 -d ' '`
+if [ -z "$pid" ]; then
+ echo "no running gwt-client found" >&2
+ exit 1
+fi
+
+cwd=`readlink "/proc/${pid}/cwd"`
+cmd=`cat "/proc/${pid}/cmdline" | tr '\0' ' '`
+cd "$cwd"
+kill -9 "$pid"
+
+sleep 1
+$cmd >/dev/null 2>&1 &
+disown -ar