From 214a3e9894acfdf2736e2a57318a2fae935f36ad Mon Sep 17 00:00:00 2001 From: Daniel Ziltener Date: Thu, 18 Feb 2021 20:13:28 +0100 Subject: [PATCH 1/2] Added option to have CP be quiet --- usr/local/share/bastille/cp.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/usr/local/share/bastille/cp.sh b/usr/local/share/bastille/cp.sh index 6c96f099..8253f8d3 100644 --- a/usr/local/share/bastille/cp.sh +++ b/usr/local/share/bastille/cp.sh @@ -32,7 +32,7 @@ . /usr/local/etc/bastille/bastille.conf usage() { - error_exit "Usage: bastille cp TARGET HOST_PATH CONTAINER_PATH" + error_exit "Usage: bastille cp TARGET HOST_PATH CONTAINER_PATH [CP_OPTIONS]" } # Handle special-case commands first. @@ -48,11 +48,21 @@ fi CPSOURCE="${1}" CPDEST="${2}" +OPTION="${3}" + +case "${OPTION}" in + -q|--quiet) + OPTION="-a" + ;; + *) + OPTION="-av" + ;; +esac for _jail in ${JAILS}; do info "[${_jail}]:" bastille_jail_path="${bastille_jailsdir}/${_jail}/root" - cp -av "${CPSOURCE}" "${bastille_jail_path}/${CPDEST}" + cp "${OPTION}" "${CPSOURCE}" "${bastille_jail_path}/${CPDEST}" RETURN="$?" if [ "${TARGET}" = "ALL" ]; then # Display the return status for reference From 2aa92042fd88d333d9654af1f850eb942f475ecb Mon Sep 17 00:00:00 2001 From: Daniel Ziltener Date: Fri, 19 Feb 2021 17:11:19 +0100 Subject: [PATCH 2/2] Adjustment for consistency --- usr/local/share/bastille/cp.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/usr/local/share/bastille/cp.sh b/usr/local/share/bastille/cp.sh index 8253f8d3..2d486ece 100644 --- a/usr/local/share/bastille/cp.sh +++ b/usr/local/share/bastille/cp.sh @@ -32,24 +32,28 @@ . /usr/local/etc/bastille/bastille.conf usage() { - error_exit "Usage: bastille cp TARGET HOST_PATH CONTAINER_PATH [CP_OPTIONS]" + error_exit "Usage: bastille cp [OPTION] TARGET HOST_PATH CONTAINER_PATH" } +CPSOURCE="${1}" +CPDEST="${2}" + # Handle special-case commands first. case "$1" in help|-h|--help) usage ;; +-q|--quiet) + OPTION="${1}" + CPSOURCE="${2}" + CPDEST="${3}" + ;; esac if [ $# -ne 2 ]; then usage fi -CPSOURCE="${1}" -CPDEST="${2}" -OPTION="${3}" - case "${OPTION}" in -q|--quiet) OPTION="-a"