2018-08-10 00:22:41 +00:00
|
|
|
#!/usr/bin/env bash
|
2018-08-18 18:42:42 +00:00
|
|
|
# Copyright (C) 2018 Luke Shumaker
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
2018-08-10 00:22:41 +00:00
|
|
|
{
|
|
|
|
set -euE
|
2018-08-16 05:32:59 +00:00
|
|
|
source ./lib/osi.sh
|
2018-08-11 18:57:24 +00:00
|
|
|
|
|
|
|
arg_image=$1
|
|
|
|
arg_src=$(realpath -ms -- "$2")
|
|
|
|
arg_dst=$3
|
2018-08-10 00:22:41 +00:00
|
|
|
|
|
|
|
mountpoint=$(mktemp -dt -- "${0##*/}.XXXXXXXXXX")
|
|
|
|
trap "rmdir -- ${mountpoint@Q}" EXIT
|
|
|
|
|
2018-08-13 03:36:53 +00:00
|
|
|
sudo -- ./osi-mount --user -- "$arg_image" "$mountpoint" cp -aT -- "$mountpoint/$arg_src" "$arg_dst"
|
2018-08-10 00:22:41 +00:00
|
|
|
}
|