nextcloud - refactor variable names

This commit is contained in:
2022-04-22 12:54:05 +02:00
parent 8d1465ced9
commit 1914f83128
2 changed files with 30 additions and 30 deletions

View File

@@ -1,4 +1,5 @@
# Configuration file for nextcloud sequence # Configuration file for nextcloud sequence
NC_INSTALL_DIR="/var/www/nextcloud" sc_ncServerUser="www-data"
NC_DATA_DIR="${NC_INSTALL_DIR}/data" sc_ncInstallDir="/var/www/nextcloud"
sc_ncDataDir="${sc_ncInstallDir}/data"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Dependency to other seqs # Dependency to other seqs
# - mysql.sh (soft; Missing informational output) # - mysql.sh (soft; Missing informational output)
@@ -8,43 +8,43 @@ localOcc=("echo" "occ not found!")
# Get script working directory # Get script working directory
# (when called from a different directory) # (when called from a different directory)
WDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >>/dev/null 2>&1 && pwd )" sq_dir="$( cd "$( dirname -- "$(realpath "${BASH_SOURCE[0]}")")" >>/dev/null 2>&1 && pwd )"
CONFIG=0 sq_config=0
CONFIG_FILE_NAME="${toolName}.cfg" sq_configFileName="${toolName}.cfg"
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example" sq_configFileTemplate="$sq_dir/${sq_configFileName}.example"
step_config() { step_config() {
## or to use sequencer api: ## or to use sequencer api:
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE" initSeqConfig "$sq_configFileName" "$sq_configFileTemplate"
if [ $? -eq 0 ] ; then if [ $? -eq 0 ] ; then
CONFIG=1 sq_config=1
fi fi
localOcc=( sudo -u www-data php "$(escpath "$NC_INSTALL_DIR/occ")" ) localOcc=( sudo -u $sc_ncServerUser php "$(escpath "$sc_ncInstallDir/occ")" )
}
step_1_info() {
echoinfoArgs "[OCC ARGS]"
echo "Execute occ command"
}
step_1_alias() { ALIAS="occ"; }
step_1() {
shift
exe "${localOcc[@]}" "$@"
} }
step_20_info() { echo "Upgrade $toolName on command line to latest version of selected release channel"; } step_20_info() { echo "Upgrade $toolName on command line to latest version of selected release channel"; }
step_20_alias() { ALIAS="upgrade"; } step_20_alias() { ALIAS="upgrade"; }
step_20() { step_20() {
if [ $CONFIG -eq 0 ] ; then if [ $sq_config -eq 0 ] ; then
echoerr " [E] No configuration found to determine installation directory" echoerr " [E] No configuration found to determine installation directory"
return 1 return 1
fi fi
exe cd "$NC_INSTALL_DIR" exe cd "$sc_ncInstallDir"
exe sudo -u www-data php "$ncInstaller" exe sudo -u www-data php "$ncInstaller"
} }
ncInstaller="updater/updater.phar" ncInstaller="updater/updater.phar"
step_100_info() {
echoinfoArgs "[OCC ARGS]"
echo "Execute occ command"
}
step_100_alias() { ALIAS="occ"; }
step_100() {
shift
exe "${localOcc[@]}" "$@"
}
step_102_info() { echoinfoArgs "<NC DATABASE> <IPV4 ADDRESS>"; echo "Delete IP from bruteforce table"; } step_102_info() { echoinfoArgs "<NC DATABASE> <IPV4 ADDRESS>"; echo "Delete IP from bruteforce table"; }
step_102_alias() { ALIAS="bruteforceRemoveIP"; } step_102_alias() { ALIAS="bruteforceRemoveIP"; }
step_102() { step_102() {
@@ -55,9 +55,9 @@ step_102() {
if [ -z $1 ] ; then if [ -z $1 ] ; then
echoerr " [E] No database provided" echoerr " [E] No database provided"
if [ -f "${WDIR}/mysql.sh" ] ; then if [ -f "${sq_dir}/mysql.sh" ] ; then
echo " [I] Available mysql databases:" echo " [I] Available mysql databases:"
"${WDIR}/mysql.sh" -qq listdb "${sq_dir}/mysql.sh" -qq listdb
fi fi
return 1 return 1
else else
@@ -108,24 +108,23 @@ step_106() {
step_110_info() { echo "Reset picture preview folder"; } step_110_info() { echo "Reset picture preview folder"; }
step_110_alias() { ALIAS="resetpreview"; } step_110_alias() { ALIAS="resetpreview"; }
step_110() { step_110() {
if [ -e "${NC_DATA_DIR}" ]; then if [ -e "${sc_ncDataDir}" ]; then
exe rm -rf "${NC_DATA_DIR}/appdata_"*"/preview/"* exe rm -rf "${sc_ncDataDir}/appdata_"*"/preview/"*
echoseq " [I] Rescan app data folder" echoseq " [I] Rescan app data folder"
exep "${localOcc[@]} files:scan-app-data &" exep "${localOcc[@]} files:scan-app-data &"
else else
echoerr " [E] Nextcloud data direcotry $NC_DATA_DIR not found" echoerr " [E] Nextcloud data direcotry $sc_ncDataDir not found"
return 1 return 1
fi fi
} }
step_200_info() { echo "Notes"; }
step_200_alias() { ALIAS="notes"; } step_200_alias() { ALIAS="notes"; }
step_200() { step_200() {
outColor green outColor green
cat<<NOTES_END cat<<NOTES_END
# Recommended preview settings # Recommended preview settings
[$NC_INSTALL_DIR/config/config.php] [$sc_ncInstallDir/config/config.php]
occ config:app:set previewgenerator squareSizes --value="32 256" occ config:app:set previewgenerator squareSizes --value="32 256"
occ config:app:set previewgenerator widthSizes --value="256 384" occ config:app:set previewgenerator widthSizes --value="256 384"
occ config:app:set previewgenerator heightSizes --value="256" occ config:app:set previewgenerator heightSizes --value="256"