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 d499e55 commit 695c6efCopy full SHA for 695c6ef
subr/nc.subr
@@ -16,10 +16,10 @@ fi
16
# return 0 if jail not exist
17
# return 1 if jail exist
18
get_jid() {
19
- local _res
+ local _res=
20
myjid="0"
21
22
- [ -z "$jname" -a -z "${path}" ] && return 0
+ [ -z "${jname}" -a -z "${path}" ] && return 0
23
24
case "${platform}" in
25
Linux)
@@ -29,12 +29,16 @@ get_jid() {
29
esac
30
31
_res=$( cbsdjls | while read _jid _name; do
32
- [ "${_name}" = "${jname}" ] && echo ${_jid}
33
- done)
+ if [ "${_name}" = "${jname}" ]; then
+ printf "${_jid}"
34
+ exit 0
35
+ fi
36
+ done )
37
38
[ -z "${_res}" ] && return 0
39
- myjid=${_res}
40
+ myjid="${_res}"
41
+
42
return 1
43
}
44
0 commit comments