Sequencer new option to open sequence config file when initialised using initSeqConfig

Sequences with exit in step_config, changed to return to support opening config file on first run
This commit is contained in:
2021-03-19 01:32:59 +01:00
parent ab1f9f761e
commit 8e63bbe7df
10 changed files with 41 additions and 30 deletions

View File

@@ -27,7 +27,7 @@ step_config() {
CONFIG=1
else
# End if no configuration file exists
[ $DRY -eq 0 ] && exit 1
[ $DRY -eq 0 ] && return 1
fi
[ $QUIET -ne 0 ] && aptOpt="-y"
}

View File

@@ -50,7 +50,7 @@ step_1() {
toolDownUrl="$1"
else
echoerr " [E] No image file provided for download"
exit -1
exit 1
fi
toolDownFile="/tmp/${toolDownUrl//*\//}"
@@ -129,7 +129,7 @@ step_10_alias() { ALIAS="setup"; }
step_10() {
if [ -z "$(ls /etc/default | grep raspi)" ] ; then
echoerr " [E] Not on a Raspberry pi"
return -1
return 1
fi
exe apt update
@@ -143,7 +143,7 @@ step_11() {
local localUsDefault="$localUs UTF-8"
if [ ! -f "$localesConfigLoc" ] ; then
echoerr " [E] Install packages locales first"
exit -1
exit 1
fi
exe sed -i "s/#[[:space:]]*\($localUsDefault\)/\1/" "$localesConfigLoc"

View File

@@ -20,7 +20,7 @@ step_config() {
if [ $? -eq 0 ] ; then
CONFIG=1
else
exit 1
[ $DRY -eq 0 ] && return 1
fi
toolSyslogTag="${SCRIPT_NAME}-$SEQ_PROFILE_NAME"
}
@@ -56,14 +56,14 @@ step_1() {
if [ -z $EBU_TARGET ] || [ -z $EBU_SOURCE ] ; then
echo " [I] Nothing to do. Check $SEQ_CONFIG_FILE"
return -1
return 1
fi
if [ ! -z "$1" ] && ( [ "$1" == "full" ] || [ "$1" == "incremental" ] ) ; then
dupArgs+=("$1")
elif [ ! -z "$1" ] ; then
echo " [W] $toolName command \"$1\" not recognized"
return -1
return 1
fi
echo " [I] Running backup profile [$SEQ_PROFILE_NAME]"
@@ -95,7 +95,7 @@ step_3() {
if [ -z $EBU_TARGET ] || [ -z $EBU_SOURCE ] ; then
echo " [I] Nothing to do. Check $SEQ_CONFIG_FILE"
return -1
return 1
fi
checkInstalled
@@ -135,7 +135,7 @@ step_5() {
if [ -z "$1" ] ; then
echoerr " [E] No target provided"
return -1
return 1
fi
local ebuLocalTarget="$1"
local ebuTarget="$EBU_TARGET"
@@ -167,7 +167,7 @@ step_7() {
dupCommand+="remove-all-inc-of-but-n-full $EBU_MAX_FULLS_WITH_INCRS "
else
if [ $QUIET -eq 0 ] ; then echoerr " [W] No purge option configured" ; fi
return -1
return 1
fi
checkInstalled
@@ -264,12 +264,6 @@ step_72() {
done
}
step_74_info() { echo "Open configuration file"; }
step_74_alias() { ALIAS='config'; }
step_74() {
exe vi "$SEQ_CONFIG_FILE"
}
step_100_info() { echo "Install $toolName $toolPpa"; }
step_100_alias() { ALIAS="install"; }
step_100() {
@@ -296,7 +290,7 @@ checkFileHead() {
local readChar
if [ ! -e "$1" ] ; then
echoerr " [E] File $1 not found"
return -1
return 1
fi
read -r -n ${#2} readChar < "$1"
if [ "$readChar" == "$2" ] ; then

View File

@@ -142,7 +142,7 @@ done"
step_11_info() { echo "Create systemd service for logging to syslog"; }
step_11() {
[ ! -f "$kodiSyslogLoc" ] && return -1
[ ! -f "$kodiSyslogLoc" ] && return 1
addConf -s "$kodiSyslogService" "$kodiSyslogServiceLoc"

View File

@@ -30,7 +30,7 @@ step_config() {
echoseq " Install: $LNMS_DIR"
echoseq " Backup: $LNMS_BU_DIR"
else
[ $DRY -eq 0 ] && exit 1
[ $DRY -eq 0 ] && return 1
fi
}

View File

@@ -34,7 +34,7 @@ step_config() {
echo " Domain: $MAS_DOMAIN"
elif [ $? -eq 1 ] ; then
# Config $CONFIG_FILE_NAME created. Needs modification first
exit 1
[ $DRY -eq 0 ] && return 1
fi
}

View File

@@ -542,8 +542,8 @@ toolScript() {
adminTokenCheck() {
if [ -z "$MATRIX_ACCESS" ] ; then
[ $QUIET -eq 0 ] && read -s -p "Please enter admin access tocken: " MATRIX_ACCESS
# return -1 if it is still empty
[ -z "$MATRIX_ACCESS" ] && return -1
# return 1 if it is still empty
[ -z "$MATRIX_ACCESS" ] && return 1
fi
return 0
}

View File

@@ -20,7 +20,7 @@ step_config() {
if [ $? -eq 0 ] ; then
CONFIG=1
else
exit 1
[ $DRY -eq 0 ] && return 1
fi
}

View File

@@ -23,7 +23,7 @@ step_config() {
if [ $? -eq 0 ] ; then
CONFIG=1
else
exit 1
[ $DRY -eq 0 ] && return 1
fi
toolConfigLoc=`eval echo "$TWXA_CONFIG_LOC"`
toolConfig="$toolConfigLoc/config_cache/$toolConfigName"