properly escape single quotes
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
aea9747918
commit
4547d2efa1
1 changed files with 4 additions and 1 deletions
|
@ -35,7 +35,10 @@ target_host="$__target_host"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
ssh="ssh -o User=root -q $target_host"
|
ssh="ssh -o User=root -q $target_host"
|
||||||
code="$ssh chroot $chroot sh -c '$@'"
|
|
||||||
|
# escape ' with '"'"'
|
||||||
|
code="$(echo "$@" | sed -e "s/'/'\"'\"'/g")"
|
||||||
|
code="$ssh chroot $chroot sh -c '$code'"
|
||||||
|
|
||||||
log "target_host: $target_host"
|
log "target_host: $target_host"
|
||||||
log "chroot: $chroot"
|
log "chroot: $chroot"
|
||||||
|
|
Loading…
Reference in a new issue