From 214a3e9894acfdf2736e2a57318a2fae935f36ad Mon Sep 17 00:00:00 2001 From: Daniel Ziltener Date: Thu, 18 Feb 2021 20:13:28 +0100 Subject: [PATCH] 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 6c96f09..8253f8d 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