File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ if [[ -f /etc/bashrc ]]; then
11
11
fi
12
12
13
13
run_doorman (){
14
- set -eux
14
+ set -ux
15
15
16
16
rm -f dm.conf
17
17
rm -f places.inc
@@ -64,7 +64,7 @@ while IFS= read -r line; do
64
64
tmp=" ${package_name# package_location_} "
65
65
ID=" ${tmp% .tgz} "
66
66
IDs=" ${IDs} ${ID} "
67
- done < FLIST
67
+ done < <( grep " package_location " FLIST)
68
68
69
69
set +e
70
70
@@ -102,24 +102,15 @@ if [[ ${send_stat} -ne 0 ]]; then
102
102
return 5
103
103
fi
104
104
105
- # Remove the working directory
106
- # shellcheck disable=SC2050
107
- if [[ " {{KEEPDATA}}" == " False" || " {{KEEPDATA}}" == " NO" ]]; then
108
- if ! cd " ${HOME} " ; then
109
- echo " Failed to navigate to ${HOME} !"
110
- return 6
111
- fi
112
- rm -rf " ${gendel} "
113
- fi
114
-
115
105
set +eux
116
106
}
117
107
118
- run_doorman >& " ${log_file} "
108
+ # Run the function, halting the function on errors, and capture the output
109
+ ( set -e; run_doorman ) >& " ${log_file} "
110
+ doorman_stat=$?
119
111
120
- if [[ $? -ne 0 ]]; then
112
+ if [[ ${doorman_stat} -ne 0 ]]; then
121
113
echo " Failed to run the doorman service!"
122
- set +eux
123
114
echo " FAILURE" >> " ${log_file} "
124
115
exit 9
125
116
fi
You can’t perform that action at this time.
0 commit comments