We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a07679a commit 8c6ee43Copy full SHA for 8c6ee43
bin/xlog
@@ -1,4 +1,4 @@
1
-#!/bin/sh
+#!/bin/bash
2
#
3
# Copyright 2013 Carnegie Mellon University
4
@@ -16,12 +16,20 @@
16
17
PORT=7777
18
19
+check() {
20
+ # see if click is running
21
+ pid=`ps aux | grep -v grep | grep userlevel/click | tr -s " " | cut -d\ -f2`
22
+ [ "$pid" == "" ] && printf "Click is not running, aborting...\n" && exit 1
23
+}
24
+
25
get() {
26
+ check
27
printf "$1: "
28
printf "read log.$1\nquit\n" | nc localhost $PORT | sed -n '4p'
29
}
30
31
put() {
32
33
printf "write log.$1 $2\nquit\n" | nc localhost $PORT > /dev/null
34
35
0 commit comments