File tree Expand file tree Collapse file tree 2 files changed +41
-27
lines changed Expand file tree Collapse file tree 2 files changed +41
-27
lines changed Original file line number Diff line number Diff line change @@ -40,32 +40,6 @@ go build
40
40
41
41
wait
42
42
43
- cf app $appname > /dev/null # Make sure app is there
44
-
45
- if ! cf app $appname | grep -q running; then
46
- echo " ERROR: $appname is not running"
47
- exit 1
48
- fi
49
-
50
- url=` cf app $appname | grep urls: | cut -d ' ' -f2`
51
-
52
- # If there's an existing client running, kill it
53
- client_pids=` ps auxww | grep ./chisel | grep 5022:2022 | grep -v grep | awk ' {print $2}' `
54
- if [ -n " $client_pids " ]; then
55
- kill $client_pids
56
- fi
57
-
58
- ./chisel client --keepalive 10s https://$url 5022:2022 > /dev/null &
59
-
60
- cat << _EOF_
61
- You can now connect via
62
-
63
- ssh vcap@localhost -p 5022
64
-
65
- or if you added an entry to ~/.ssh/config:
66
-
67
- ssh chisel
68
-
69
- _EOF_
43
+ ./tunnel
70
44
71
45
# vi: expandtab sw=2 ts=2
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e # exit on error
4
+
5
+ cd ` dirname $0 `
6
+
7
+ appname=" cf-ssh-chisel-$USER "
8
+
9
+ echo " Checking if $appname is running"
10
+ cf app $appname > /dev/null # Make sure app is there
11
+
12
+ if ! cf app $appname | grep -q running; then
13
+ echo " ERROR: $appname is not running"
14
+ exit 1
15
+ fi
16
+
17
+ echo " Obtaining url for $appname "
18
+ url=` cf app $appname | grep urls: | cut -d ' ' -f2`
19
+
20
+ # If there's an existing client running, kill it
21
+ client_pids=` ps auxww | grep ./chisel | grep 5022:2022 | grep -v grep | awk ' {print $2}' `
22
+ if [ -n " $client_pids " ]; then
23
+ kill $client_pids
24
+ fi
25
+
26
+ echo " Starting client, connecting to $url "
27
+ ./chisel client --keepalive 10s https://$url 5022:2022 > /dev/null &
28
+
29
+ cat << _EOF_
30
+ You can now connect via
31
+
32
+ ssh vcap@localhost -p 5022
33
+
34
+ or if you added an entry to ~/.ssh/config:
35
+
36
+ ssh chisel
37
+
38
+ _EOF_
39
+
40
+ # vi: expandtab sw=2 ts=2
You can’t perform that action at this time.
0 commit comments