grocy - Adapt to new sequencer options

This commit is contained in:
2022-06-11 09:45:18 +02:00
parent ad93a5eb9c
commit 54cfcef9f1

View File

@@ -13,25 +13,17 @@ sc_grocyConf=
sc_grocyBackup="data/backup"
sc_grocyViewcache="data/viewcache"
grocyDownLoc="/tmp/grocy_latest.zip"
# Get script working directory
# (when called from a different directory and even when called via symlink)
readonly sq_dir="$(cd "$(dirname -- "$(realpath ${BASH_SOURCE[0]})")" >>/dev/null 2>&1 && pwd)"
readonly sq_scriptFile=$(basename -- $0)
readonly sq_scriptName=${sq_scriptFile%%.*}
readonly sq_configFileName="${sq_scriptName}.cfg"
readonly sq_configFileTemplate="$sq_dir/${sq_configFileName}.example"
sq_grocyDownLoc="/tmp/grocy_latest.zip"
sq_aptOpt=
sq_config=0
seq_config() {
initSeqConfig -p "$sq_scriptName" "$sq_configFileTemplate"
initSeqConfig -p "$seq_fileName" "$seq_configTemplate"
if [ $? -eq 0 ] ; then
sq_config=1
else
# End if no configuration file exists
dry || return -1
dry || return 1
fi
# config not sourced if only profiles should be listed
@@ -57,17 +49,17 @@ step_1_alias() { echo "status"; }
step_1() {
getVersions
if [ -e "${sc_grocyDir}" ] ; then
echo
echo "$toolName installed"
echo " at: ${sc_grocyDir}"
echo " version: ${versionNow}"
echo " config: ${sc_grocyConf}"
echo -n " update: "
info
info "$toolName installed"
info -a " at: ${sc_grocyDir}"
info -a " version: ${versionNow}"
info -a " config: ${sc_grocyConf}"
info -an " update: "
if [[ ! ${versionNow} = ${versionNew} ]] ; then
echo "available: ${versionNew}}"
info -d "available: ${versionNew}"
return 1
else
echo "already on latest"
info -d "already on latest"
return 0
fi
else
@@ -102,14 +94,14 @@ step_22() {
info "Installing $toolName version ${versionNew}"
fi
fi
exe wget ${downUrl} -q -O "${grocyDownLoc}"
exe wget ${downUrl} -q -O "${sq_grocyDownLoc}"
endReturn -o $? "Download failed"
if [ -e "${sc_grocyDir}" ] ; then
step backup
exe rm -rf "${sc_grocyDir}/${sc_grocyViewcache}"
fi
exe rm -rf "${sc_grocyDir}/"!(data)
exe unzip -o -qq "${grocyDownLoc}" -d "${sc_grocyDir}"
exe unzip -o -qq "${sq_grocyDownLoc}" -d "${sc_grocyDir}"
exe chown -R www-data: "${sc_grocyDir}/public" "${sc_grocyDir}/data"
# Populate first config
if [ ! -e "${sc_grocyConf}" ] ; then