Fix container case (probably).
This commit is contained in:
parent
49168edafb
commit
47781e8bcf
1 changed files with 4 additions and 5 deletions
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
_tarback_plugin_docker_use_container=false
|
_tarback_plugin_docker_use_container=
|
||||||
|
|
||||||
short_options='c'
|
short_options='c:'
|
||||||
while getopts "$short_options" arg; do
|
while getopts "$short_options" arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
c)
|
c)
|
||||||
|
@ -11,13 +11,12 @@ while getopts "$short_options" arg; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if "$_tarback_plugin_docker_use_container"; then
|
if [ -n "$_tarback_plugin_docker_use_container" ]; then
|
||||||
_tarback_plugin_docker_cmd='docker exec -i "$1" '
|
_tarback_plugin_docker_cmd="docker exec -i '$_tarback_plugin_docker_use_container' "
|
||||||
TARBACK_TAR_CREATE_COMMAND="$_tarback_plugin_docker_cmd $TARBACK_TAR_CREATE_COMMAND"
|
TARBACK_TAR_CREATE_COMMAND="$_tarback_plugin_docker_cmd $TARBACK_TAR_CREATE_COMMAND"
|
||||||
TARBACK_TAR_EXTRACT_COMMAND="$_tarback_plugin_docker_cmd $TARBACK_TAR_EXTRACT_COMMAND"
|
TARBACK_TAR_EXTRACT_COMMAND="$_tarback_plugin_docker_cmd $TARBACK_TAR_EXTRACT_COMMAND"
|
||||||
else
|
else
|
||||||
_tarback_plugin_docker_cmd='docker run -i --rm --workdir=/mnt --volume="$1":/mnt/"$1" alpine '
|
_tarback_plugin_docker_cmd='docker run -i --rm --workdir=/mnt --volume="$1":/mnt/"$1" alpine '
|
||||||
|
|
||||||
TARBACK_TAR_CREATE_COMMAND="$_tarback_plugin_docker_cmd $(echo "$TARBACK_TAR_CREATE_COMMAND" | sed 's_$1_/mnt/$1_g')"
|
TARBACK_TAR_CREATE_COMMAND="$_tarback_plugin_docker_cmd $(echo "$TARBACK_TAR_CREATE_COMMAND" | sed 's_$1_/mnt/$1_g')"
|
||||||
TARBACK_TAR_EXTRACT_COMMAND="$_tarback_plugin_docker_cmd $(echo "$TARBACK_TAR_EXTRACT_COMMAND" | sed 's_$1_/mnt/$1_g')"
|
TARBACK_TAR_EXTRACT_COMMAND="$_tarback_plugin_docker_cmd $(echo "$TARBACK_TAR_EXTRACT_COMMAND" | sed 's_$1_/mnt/$1_g')"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue