File tree 1 file changed +22
-7
lines changed
1 file changed +22
-7
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ # terminal 1: run PORT=3100 node app.js
4
+ # expected output after terminal 2 curl's:
5
+ # radsauce
6
+
7
+ # terminal 2: ./verifyscript.sh && echo "it worked" || echo "fail"
8
+ # expected output:
9
+ # radsauce
10
+ # it worked
11
+
3
12
OUTPUT=" $( curl --request POST -d radsauce http://localhost:3100/foo -H " Content-Type: text/plain" 2> /dev/null ) "
4
13
5
14
echo " ${OUTPUT} "
6
- #
7
- if [ " ${OUTPUT} " = " radsauce" ];
8
15
9
- then
10
16
11
- echo " gimme things 'cause it's the same: OUTPUT is ${OUTPUT} " ;
17
+ if [ " ${OUTPUT} " = " radsauce " ] ; then
12
18
13
- fi
19
+ # this next line is unnecessary, just exists to clarify purpose:
20
+ echo " success, child process exit code 0: OUTPUT is ${OUTPUT} " ;
21
+
22
+ exit 0;
14
23
15
- # else
16
- # echo "nope failure";
24
+ else
25
+
26
+ # this next line is unnecessary, just exists to clarify purpose:
27
+ echo " failure, child process exit code 1: OUTPUT is ${OUTPUT} " ;
28
+
29
+ exit 1;
30
+
31
+ fi
You can’t perform that action at this time.
0 commit comments