Fix unbound variable errors

This commit is contained in:
2022-06-02 16:08:07 +02:00
parent a6eeccb417
commit 4f8c1b5388
15 changed files with 85 additions and 86 deletions

View File

@@ -19,36 +19,35 @@ CONFIG_FILE_NAME="${toolName}.cfg"
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
seq_config() {
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
if [ $? -eq 0 ] ; then
if initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE" ; then
CONFIG=1
else
dry || return 1
fi
toolConfigLoc=`eval echo "$TWXA_CONFIG_LOC"`
toolConfigLoc=`eval echo "${TWXA_CONFIG_LOC:-}"`
toolConfig="$toolConfigLoc/config_cache/$toolConfigName"
toolHtmlLoc=`eval echo "$TWXA_HTML_LOC"`
toolBackupLoc=`eval echo "$TWXA_BACKUP_LOC"`
toolGitLoc=`eval echo "$TWXA_GIT_LOC"`
gitLibLoc=`eval echo "$TWXA_GIT_LOC/var/lib/torrentwatch-xa"`
gitHtmlLoc=`eval echo "$TWXA_GIT_LOC/var/www/html/torrentwatch-xa"`
echo " git: $toolGitLoc"
echo " config: $toolConfig"
echo " html: $toolHtmlLoc"
echo " backup: $toolBackupLoc"
toolHtmlLoc=`eval echo "${TWXA_HTML_LOC:-}"`
toolBackupLoc=`eval echo "${TWXA_BACKUP_LOC:-}"`
toolGitLoc=`eval echo "${TWXA_GIT_LOC:-}"`
gitLibLoc=`eval echo "${TWXA_GIT_LOC:-}/var/lib/torrentwatch-xa"`
gitHtmlLoc=`eval echo "${TWXA_GIT_LOC:-}/var/www/html/torrentwatch-xa"`
info " git: $toolGitLoc"
info -a "config: $toolConfig"
info -a " html: $toolHtmlLoc"
info -a "backup: $toolBackupLoc"
}
step_1_info() { echo "Install $toolName [VERSION]"; }
step_1_alias() { echo "install"; }
step_1() {
shift
if [ ! -z $1 ] ; then
if [ -n "${1:-}" ] ; then
toolVersion="$1"
fi
echo $toolConfig
}
step_2_info() { echo "Setup git repository at $toolGitLoc [VERSION e.g. 1.4.1]"; }
step_2_info() { echo "Setup git repository at ${toolGitLoc:-} [VERSION e.g. 1.4.1]"; }
step_2_alias() { echo "git"; }
step_2() {
shift
@@ -60,7 +59,7 @@ step_2() {
exe cd "$toolGitLoc"
exe git pull
fi
if [ ! -z $1 ] ; then
if [ -n "${1:-}" ] ; then
toolVersion="$1"
fi
exe git checkout $toolVersion
@@ -76,7 +75,7 @@ step_20() {
fi
local buType="all"
if [ ! -z $1 ] ; then
if [ -n "${1:-}" ] ; then
buType="$1"
fi
local buDate=`date +%Y%m%d-%H%M%S`
@@ -118,7 +117,7 @@ step_30_info() { echo "Upgrade $toolName [VERSION]"; }
step_30_alias() { echo "upgrade"; }
step_30() {
shift
if [ ! -z $1 ] ; then
if [ -n "${1:-}" ] ; then
toolVersion="$1"
fi