sequpgrade - fix some variable rename regex statements

This commit is contained in:
2022-06-01 14:27:28 +02:00
parent 2ea45fd9fd
commit e4e909c946
4 changed files with 27 additions and 27 deletions

View File

@@ -36,7 +36,7 @@ step_1() {
local buTarget="/backup" local buTarget="/backup"
if [ $CONFIG -eq 0 ] ; then if [ $CONFIG -eq 0 ] ; then
error -e "Cannot backup root without properly configured excludes" error -e "Cannot backup root without properly configured excludes"
error -e " (expected config: $SEQ_CONFIG_HOME/$CONFIG_FILE_NAME)" error -e " (expected config: $seq_configRoot/$CONFIG_FILE_NAME)"
else else
buTarget="$BACKUP_TARGET" buTarget="$BACKUP_TARGET"
fi fi

View File

@@ -22,7 +22,7 @@ seq_config() {
else else
dry || return 1 dry || return 1
fi fi
toolSyslogTag="${SCRIPT_NAME}-$SEQ_PROFILE_NAME" toolSyslogTag="${SCRIPT_NAME}-$seq_profileName"
} }
step_1_info() { step_1_info() {
@@ -30,7 +30,7 @@ step_1_info() {
if contextHelp ; then if contextHelp ; then
echo -n "selected profile" echo -n "selected profile"
else else
echo -n "profile: $SEQ_PROFILE_NAME" echo -n "profile: $seq_profileName"
fi fi
echo " [OPTIONS] [full|incremental]" echo " [OPTIONS] [full|incremental]"
echoinfo " [OPTIONS]" echoinfo " [OPTIONS]"
@@ -55,7 +55,7 @@ step_1() {
done done
if [ -z $EBU_TARGET ] || [ -z $EBU_SOURCE ] ; then if [ -z $EBU_TARGET ] || [ -z $EBU_SOURCE ] ; then
echo " [I] Nothing to do. Check $SEQ_CONFIG_FILE" echo " [I] Nothing to do. Check $seq_configFile"
return 1 return 1
fi fi
@@ -66,7 +66,7 @@ step_1() {
return 1 return 1
fi fi
echo " [I] Running backup profile [$SEQ_PROFILE_NAME]" echo " [I] Running backup profile [$seq_profileName]"
if [ "${dupArgs[0]}" != "full" ] && [ ! -z "$EBU_MAX_FULLBKP_AGE" ] ; then if [ "${dupArgs[0]}" != "full" ] && [ ! -z "$EBU_MAX_FULLBKP_AGE" ] ; then
dupArgs+=(--full-if-older-than "$EBU_MAX_FULLBKP_AGE") dupArgs+=(--full-if-older-than "$EBU_MAX_FULLBKP_AGE")
@@ -94,7 +94,7 @@ step_3() {
shift shift
if [ -z $EBU_TARGET ] || [ -z $EBU_SOURCE ] ; then if [ -z $EBU_TARGET ] || [ -z $EBU_SOURCE ] ; then
echo " [I] Nothing to do. Check $SEQ_CONFIG_FILE" echo " [I] Nothing to do. Check $seq_configFile"
return 1 return 1
fi fi
@@ -185,7 +185,7 @@ step_20_info() {
elif [ ! -z "$1" ]; then elif [ ! -z "$1" ]; then
echo "Status of target: $ebuTarget" echo "Status of target: $ebuTarget"
else else
echo "Status of profile \"$SEQ_PROFILE_NAME\" target: $ebuTarget" echo "Status of profile \"$seq_profileName\" target: $ebuTarget"
fi fi
} }
step_20_alias() { echo 'status'; } step_20_alias() { echo 'status'; }
@@ -219,7 +219,7 @@ step_70_info() {
if contextHelp ; then if contextHelp ; then
echo -n "selected profile" echo -n "selected profile"
else else
echo -n "profile: $SEQ_PROFILE_NAME" echo -n "profile: $seq_profileName"
fi fi
echo " [OPTIONS]" echo " [OPTIONS]"
echoinfo " [OPTIONS]" echoinfo " [OPTIONS]"
@@ -230,9 +230,9 @@ step_70() {
shift shift
local arg local arg
local cronRemove=0 local cronRemove=0
local cronScript="$toolCronDir/${toolPrefix}$SEQ_PROFILE_NAME" local cronScript="$toolCronDir/${toolPrefix}$seq_profileName"
local cronLog='>/dev/null' local cronLog='>/dev/null'
local cronEntry="$EBU_CRONTIME $(whoami) $WDIR/$(basename -- $0) -qq -p $SEQ_PROFILE_NAME" local cronEntry="$EBU_CRONTIME $(whoami) $WDIR/$(basename -- $0) -qq -p $seq_profileName"
for arg in "$@" ; do for arg in "$@" ; do
case "$1" in case "$1" in
@@ -244,7 +244,7 @@ step_70() {
done done
if [ ! -z "$EBU_LOG_DIR" ] ; then if [ ! -z "$EBU_LOG_DIR" ] ; then
cronLog="$EBU_LOG_DIR/${toolPrefix}${SEQ_PROFILE_NAME}.log" cronLog="$EBU_LOG_DIR/${toolPrefix}${seq_profileName}.log"
exe touch "$cronLog" exe touch "$cronLog"
exe chmod 600 "$cronLog" exe chmod 600 "$cronLog"
fi fi
@@ -252,16 +252,16 @@ step_70() {
cronEntry+=" >$cronLog" cronEntry+=" >$cronLog"
if [ -z "$EBU_CRONTIME" ] || [ $cronRemove -ne 0 ] ; then if [ -z "$EBU_CRONTIME" ] || [ $cronRemove -ne 0 ] ; then
echo " [I] Removing cron for profile $SEQ_PROFILE_NAME" echo " [I] Removing cron for profile $seq_profileName"
exe rm -r "$cronScript" exe rm -r "$cronScript"
else else
checkFileHead "$cronScript" "$cronEntry" checkFileHead "$cronScript" "$cronEntry"
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
echo " [I] Update cron for profile $SEQ_PROFILE_NAME" echo " [I] Update cron for profile $seq_profileName"
exep "sudo echo \"$cronEntry\" > \"$cronScript\"" exep "sudo echo \"$cronEntry\" > \"$cronScript\""
syslogEntry "Cron file update complete [$EBU_CRONTIME]" syslogEntry "Cron file update complete [$EBU_CRONTIME]"
else else
echo " [I] Cron for profile $SEQ_PROFILE_NAME is up to date" echo " [I] Cron for profile $seq_profileName is up to date"
fi fi
fi fi
} }
@@ -269,9 +269,9 @@ step_70() {
step_72_info() { echo "Update all profile cron files"; } step_72_info() { echo "Update all profile cron files"; }
step_72_alias() { echo "reload"; } step_72_alias() { echo "reload"; }
step_72() { step_72() {
for seq in "$SEQ_CONFIG_HOME/"* ; do for seq in "$seq_configRoot/"* ; do
seq=$(basename ${seq}) seq=$(basename ${seq})
$WDIR/$(basename -- $0) $SEQUENCER_ARGS -qq -p ${seq%%.*} cron $WDIR/$(basename -- $0) $sqr_args -qq -p ${seq%%.*} cron
done done
} }

View File

@@ -211,7 +211,7 @@ step_16_info() {
step_16_alias() { echo "listuser"; } step_16_alias() { echo "listuser"; }
step_16() { step_16() {
adminTokenCheck adminTokenCheck
endReturn -o $? "Admin token needed. Check $SEQ_CONFIG_FILE" endReturn -o $? "Admin token needed. Check $seq_configFile"
shift shift
local synapseIP=localhost local synapseIP=localhost
@@ -280,7 +280,7 @@ step_22_info() {
step_22_alias() { echo "listrooms"; } step_22_alias() { echo "listrooms"; }
step_22() { step_22() {
adminTokenCheck adminTokenCheck
endReturn -o $? "Admin token needed. Check $SEQ_CONFIG_FILE" endReturn -o $? "Admin token needed. Check $seq_configFile"
shift shift
local arg local arg
@@ -316,7 +316,7 @@ step_24_info() {
step_24_alias() { echo "listmember"; } step_24_alias() { echo "listmember"; }
step_24() { step_24() {
adminTokenCheck adminTokenCheck
endReturn -o $? "Admin token needed. Check $SEQ_CONFIG_FILE" endReturn -o $? "Admin token needed. Check $seq_configFile"
shift shift
local roomId="" local roomId=""
@@ -356,7 +356,7 @@ step_26_info() {
step_26_alias() { echo "purge"; } step_26_alias() { echo "purge"; }
step_26() { step_26() {
adminTokenCheck adminTokenCheck
endReturn -o $? "Admin token needed. Check $SEQ_CONFIG_FILE" endReturn -o $? "Admin token needed. Check $seq_configFile"
shift shift
local i local i
@@ -387,7 +387,7 @@ step_28_info() {
step_28_alias() { echo "deleteroom"; } step_28_alias() { echo "deleteroom"; }
step_28() { step_28() {
adminTokenCheck adminTokenCheck
endReturn -o $? "Admin token needed. Check $SEQ_CONFIG_FILE" endReturn -o $? "Admin token needed. Check $seq_configFile"
shift shift
local roomId="" local roomId=""
@@ -514,7 +514,7 @@ step_56() {
echo " [I] Transfer both backup files to target server" echo " [I] Transfer both backup files to target server"
echo echo
echo " [I] Install $toolName on the target server up to step \"virtualenv\"" echo " [I] Install $toolName on the target server up to step \"virtualenv\""
echo " (Stop after first run and edit $SEQ_CONFIG_FILE)" echo " (Stop after first run and edit $seq_configFile)"
echo " ./matrix.sh install" echo " ./matrix.sh install"
echo " cd ${MATRIX_HOME}" echo " cd ${MATRIX_HOME}"
echo " tar xf ...synapse_bu.tar.gz" echo " tar xf ...synapse_bu.tar.gz"

View File

@@ -76,11 +76,11 @@ makechanges() {
exe sed ${inplace} 's/^[[:space:]]*step_config/seq_config/'${sedprint} "${file}" exe sed ${inplace} 's/^[[:space:]]*step_config/seq_config/'${sedprint} "${file}"
exe sed ${inplace} 's/^\(step_.*_alias\)()[[:space:]]*{[[:space:]]*ALIAS=/\1() { echo /'${sedprint} "${file}" exe sed ${inplace} 's/^\(step_.*_alias\)()[[:space:]]*{[[:space:]]*ALIAS=/\1() { echo /'${sedprint} "${file}"
exe sed ${inplace} 's/^SEQUENCER_ARGS/sqr_args/'${sedprint} "${file}" exe sed ${inplace} 's/SEQUENCER_ARGS/sqr_args/'${sedprint} "${file}"
exe sed ${inplace} 's/^STEP_ARGS/seq_args/'${sedprint} "${file}" exe sed ${inplace} 's/STEP_ARGS/seq_args/'${sedprint} "${file}"
exe sed ${inplace} 's/^SEQ_CONFIG_HOME/seq_configRoot/'${sedprint} "${file}" exe sed ${inplace} 's/SEQ_CONFIG_HOME/seq_configRoot/'${sedprint} "${file}"
exe sed ${inplace} 's/^SEQ_CONFIG_FILE/seq_configFile/'${sedprint} "${file}" exe sed ${inplace} 's/SEQ_CONFIG_FILE/seq_configFile/'${sedprint} "${file}"
exe sed ${inplace} 's/^SEQ_PROFILE_NAME/seq_profileName/'${sedprint} "${file}" exe sed ${inplace} 's/SEQ_PROFILE_NAME/seq_profileName/'${sedprint} "${file}"
exe sed ${inplace} 's/^VERSION_SEQREV.*/readonly sqr_minVersion=16/'${sedprint} "${file}" exe sed ${inplace} 's/^VERSION_SEQREV.*/readonly sqr_minVersion=16/'${sedprint} "${file}"
done done
} }