/usr/local/jetapps/usr/share/rear/lib
# drlm-functions.sh # # DRLM functions for Relax-and-Recover # # This file is part of Relax-and-Recover, licensed under the GNU General # Public License. Refer to the included COPYING for full text of license. function drlm_import_runtime_config() { for arg in "${ARGS[@]}" ; do key=DRLM_"${arg%%=*}" val="${arg#*=}" eval $key='$val' Log "Setting $key=$val" done if ! has_binary curl ; then Error "DRLM_MANAGED: Need 'curl' to download DRLM dynamic configuration. Please install curl and try again." fi # Source ReaR config files (same as a local etc/rear/local.conf file and other usual ReaR config files) # which are stored on a DRLM server where various ReaR configs of various clients are managed centrally # cf. https://github.com/rear/rear/issues/3294 if [[ "$DRLM_SERVER" && "$DRLM_REST_OPTS" && "$DRLM_ID" ]]; then if [ "$CONFIG_APPEND_FILES" ]; then for config_append_file in $CONFIG_APPEND_FILES ; do LogPrint "DRLM_MANAGED: Loading configuration '$config_append_file' from DRLM ..." local DRLM_CFG="$TMP_DIR/$config_append_file" local http_response_code=$(curl $verbose -f -s -S -w '%{http_code}' $DRLM_REST_OPTS -o $DRLM_CFG https://$DRLM_SERVER/clients/$DRLM_ID/config/$config_append_file) test "200" = "$http_response_code" || Error "DRLM_MANAGED: curl failed with HTTP response code '$http_response_code' trying to load '$config_append_file' from DRLM." source $DRLM_CFG rm $DRLM_CFG done else LogPrint "DRLM_MANAGED: Loading configuration from DRLM ..." local DRLM_CFG="$TMP_DIR/drlm_config" local http_response_code=$(curl $verbose -f -s -S -w '%{http_code}' $DRLM_REST_OPTS -o $DRLM_CFG https://$DRLM_SERVER/clients/$DRLM_ID/config) test "200" = "$http_response_code" || Error "DRLM_MANAGED: curl failed with HTTP response code '$http_response_code' trying to load configuration from DRLM." source $DRLM_CFG rm $DRLM_CFG fi else Error "DRLM_MANAGED: Please be sure DRLM_SERVER, DRLM_REST_OPTS and DRLM_ID are properly defined in local.conf or at set them at runtime (see: default.conf)" fi } function drlm_send_log() { # send log file in real time to DRLM LogPrint "DRLM_MANAGED: Sending Logfile: '$RUNTIME_LOGFILE' to DRLM in real time ..." ( tail -f --lines=5000 --pid=$$ $RUNTIME_LOGFILE | curl $verbose -T- -f -s -S $DRLM_REST_OPTS https://$DRLM_SERVER/clients/$DRLM_ID/log/$WORKFLOW/$(date +%Y%m%d%H%M%S) ) & }
.
Edit
..
Edit
.shellcheckrc
Edit
_input-output-functions.sh
Edit
array-functions.sh
Edit
authtoken-functions.sh
Edit
bareos-functions.sh
Edit
bootloader-functions.sh
Edit
borg-functions.sh
Edit
checklayout-workflow.sh
Edit
columns-functions.sh
Edit
config-functions.sh
Edit
drlm-functions.sh
Edit
dump-workflow.sh
Edit
filesystems-functions.sh
Edit
finalizeonly-workflow.sh
Edit
format-workflow.sh
Edit
framework-functions.sh
Edit
global-functions.sh
Edit
help-workflow.sh
Edit
hp_raid-functions.sh
Edit
layout-functions.sh
Edit
layoutonly-workflow.sh
Edit
linux-functions.sh
Edit
mail-functions.sh
Edit
mkbackup-workflow.sh
Edit
mkbackuponly-workflow.sh
Edit
mkboot-workflow.sh
Edit
mkopalpba-workflow.sh
Edit
mkrescue-functions.sh
Edit
mkrescue-workflow.sh
Edit
mountonly-workflow.sh
Edit
network-functions.sh
Edit
opal-functions.sh
Edit
opaladmin-workflow.sh
Edit
output-functions.sh
Edit
progresssubsystem.nosh
Edit
rear-shell.bashrc
Edit
recover-workflow.sh
Edit
restoreonly-workflow.sh
Edit
rsync-functions.sh
Edit
savelayout-workflow.sh
Edit
serial-functions.sh
Edit
sesam-functions.sh
Edit
shell-workflow.sh
Edit
udev-workflow.sh
Edit
uefi-functions.sh
Edit
validate-workflow.sh
Edit
validated
Edit
write-protect-functions.sh
Edit