Add .editorconfig and correct indentation for many seqs
This commit is contained in:
6
.editorconfig
Normal file
6
.editorconfig
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*.{sh,cfg,example}]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
@@ -108,7 +108,7 @@ step_3() {
|
|||||||
echoerr " [E] Nothing found to backup $1"
|
echoerr " [E] Nothing found to backup $1"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
buLog=$(basename $1)
|
buLog=$(basename $1)
|
||||||
if [ "$buLog" == "/" ] ; then
|
if [ "$buLog" == "/" ] ; then
|
||||||
buLog="root"
|
buLog="root"
|
||||||
@@ -119,7 +119,7 @@ step_3() {
|
|||||||
fi
|
fi
|
||||||
buLog="backup_${buLog}"
|
buLog="backup_${buLog}"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
if [ $configTarget -ne 0 ] && [ $CONFIG -ne 0 ] ; then
|
if [ $configTarget -ne 0 ] && [ $CONFIG -ne 0 ] ; then
|
||||||
# Taking target from config
|
# Taking target from config
|
||||||
buTarget=$(echo "$BACKUP_TARGET" | sed 's:/*$::')
|
buTarget=$(echo "$BACKUP_TARGET" | sed 's:/*$::')
|
||||||
@@ -140,7 +140,7 @@ step_3() {
|
|||||||
for exclu in "$@"; do
|
for exclu in "$@"; do
|
||||||
buExcludes+=("--exclude='$exclu'")
|
buExcludes+=("--exclude='$exclu'")
|
||||||
done
|
done
|
||||||
|
|
||||||
echoseq " [I] Source : $buSource"
|
echoseq " [I] Source : $buSource"
|
||||||
echoseq " [I] Target : $buTarget"
|
echoseq " [I] Target : $buTarget"
|
||||||
echoseq " [I] Excludes: $@"
|
echoseq " [I] Excludes: $@"
|
||||||
@@ -158,7 +158,7 @@ step_3() {
|
|||||||
exep "mount -o rw,remount '${buTarget}' >>/dev/null 2>&1"
|
exep "mount -o rw,remount '${buTarget}' >>/dev/null 2>&1"
|
||||||
endReturn -o $? "Remount (${buTarget}) to be writable failed"
|
endReturn -o $? "Remount (${buTarget}) to be writable failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -w "${buTarget}" ] ; then
|
if [ ! -w "${buTarget}" ] ; then
|
||||||
echoerr " [E] Backup target (${buTarget}) is not writable"
|
echoerr " [E] Backup target (${buTarget}) is not writable"
|
||||||
exit 1
|
exit 1
|
||||||
|
@@ -40,7 +40,7 @@ step_1() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo " [I] Detected OS: $osName $distName"
|
echo " [I] Detected OS: $osName $distName"
|
||||||
|
|
||||||
local aptOption=
|
local aptOption=
|
||||||
if [ $QUIET -ne 0 ] ; then
|
if [ $QUIET -ne 0 ] ; then
|
||||||
aptOption="-y"
|
aptOption="-y"
|
||||||
|
@@ -61,7 +61,7 @@ step_10() {
|
|||||||
lecho="echo"
|
lecho="echo"
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local pubIp
|
local pubIp
|
||||||
|
|
||||||
while [ $retryCount -gt 0 ]; do
|
while [ $retryCount -gt 0 ]; do
|
||||||
|
@@ -272,7 +272,7 @@ read_sd_dev() {
|
|||||||
SDDEV=
|
SDDEV=
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$SDDEV" =~ .*blk.* ]] ; then
|
if [[ "$SDDEV" =~ .*blk.* ]] ; then
|
||||||
partExt="p"
|
partExt="p"
|
||||||
fi
|
fi
|
||||||
|
@@ -12,7 +12,7 @@ CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
|
|||||||
|
|
||||||
step_config() {
|
step_config() {
|
||||||
checkVpn
|
checkVpn
|
||||||
|
|
||||||
initSeqConfig -t "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
|
initSeqConfig -t "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
|
||||||
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
||||||
CONFIG=1
|
CONFIG=1
|
||||||
@@ -50,10 +50,11 @@ step_2() {
|
|||||||
|
|
||||||
step_3_info() { echo "Add system user"; }
|
step_3_info() { echo "Add system user"; }
|
||||||
step_3() {
|
step_3() {
|
||||||
exe adduser --system $DLD_USER --group --home "${DLD_CONFDIR}"
|
exe adduser --system $DLD_USER --group --home "${DLD_CONFDIR}"
|
||||||
}
|
}
|
||||||
|
|
||||||
step_4_info() { echo "Install sonarr"
|
step_4_info() {
|
||||||
|
echo "Install sonarr"
|
||||||
echoinfo "Default port: 8989"
|
echoinfo "Default port: 8989"
|
||||||
}
|
}
|
||||||
step_4() {
|
step_4() {
|
||||||
@@ -121,7 +122,7 @@ step_7_info() {
|
|||||||
step_7() {
|
step_7() {
|
||||||
local jTar="/tmp/Jackett.tgz"
|
local jTar="/tmp/Jackett.tgz"
|
||||||
local jUrl="https://github.com/Jackett/Jackett/releases/latest/download/Jackett.Binaries.LinuxARM64.tar.gz"
|
local jUrl="https://github.com/Jackett/Jackett/releases/latest/download/Jackett.Binaries.LinuxARM64.tar.gz"
|
||||||
|
|
||||||
[ ! -e "$jTar" ] && exe curl -sL "$jUrl" -o "$jTar"
|
[ ! -e "$jTar" ] && exe curl -sL "$jUrl" -o "$jTar"
|
||||||
|
|
||||||
exe tar xvzf "$jTar" -C "${DLD_DIR}"
|
exe tar xvzf "$jTar" -C "${DLD_DIR}"
|
||||||
@@ -281,9 +282,9 @@ step_14() {
|
|||||||
local lService=`eval "echo \"$bazarrService\""`
|
local lService=`eval "echo \"$bazarrService\""`
|
||||||
local bazarrVenv="${DLD_DIR}/bazarr"
|
local bazarrVenv="${DLD_DIR}/bazarr"
|
||||||
local bazarrDir="${bazarrVenv}/bazarr"
|
local bazarrDir="${bazarrVenv}/bazarr"
|
||||||
|
|
||||||
local bazarrGitUrl="https://github.com/morpheus65535/bazarr.git"
|
local bazarrGitUrl="https://github.com/morpheus65535/bazarr.git"
|
||||||
|
|
||||||
exe python3 -m venv "$bazarrVenv"
|
exe python3 -m venv "$bazarrVenv"
|
||||||
endReturn -o $? "Creating virtual environment failed"
|
endReturn -o $? "Creating virtual environment failed"
|
||||||
|
|
||||||
@@ -348,7 +349,7 @@ step_16() {
|
|||||||
|
|
||||||
cat /etc/apt/sources.list | grep -E "^deb-src" >>/dev/null 2>&1
|
cat /etc/apt/sources.list | grep -E "^deb-src" >>/dev/null 2>&1
|
||||||
endReturn -o $? "No deb-src entry found in /etc/apt/sources.list"
|
endReturn -o $? "No deb-src entry found in /etc/apt/sources.list"
|
||||||
|
|
||||||
exe mkdir -p "$buildPath"
|
exe mkdir -p "$buildPath"
|
||||||
exe cd "$buildPath"
|
exe cd "$buildPath"
|
||||||
exe apt build-dep unrar-nonfree $APTOPT
|
exe apt build-dep unrar-nonfree $APTOPT
|
||||||
@@ -453,12 +454,12 @@ step_21() {
|
|||||||
[ ! -e "$pTar" ] && exe wget --content-disposition "$pUrl" -O "$pTar"
|
[ ! -e "$pTar" ] && exe wget --content-disposition "$pUrl" -O "$pTar"
|
||||||
|
|
||||||
if [ -e "$pInstallDir" ]; then
|
if [ -e "$pInstallDir" ]; then
|
||||||
prowlarrUpgrade=1
|
prowlarrUpgrade=1
|
||||||
echoseq " [I] Stopping prowlarr service"
|
echoseq " [I] Stopping prowlarr service"
|
||||||
echoseq " Service will not be started automatically after update"
|
echoseq " Service will not be started automatically after update"
|
||||||
exe service prowlarr stop
|
exe service prowlarr stop
|
||||||
echoseq " [I] Moving existing $pInstallDir as backup"
|
echoseq " [I] Moving existing $pInstallDir as backup"
|
||||||
exe mv "$pInstallDir" "${pInstallDir}_bu_"`date +%Y%m%d-%H%M%S`
|
exe mv "$pInstallDir" "${pInstallDir}_bu_"`date +%Y%m%d-%H%M%S`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exe tar xvzf "$pTar" -C "${DLD_DIR}"
|
exe tar xvzf "$pTar" -C "${DLD_DIR}"
|
||||||
@@ -535,12 +536,12 @@ step_30() {
|
|||||||
[ ! -e "$readarrTar" ] && exe wget --content-disposition "$lUrl" -O "$readarrTar"
|
[ ! -e "$readarrTar" ] && exe wget --content-disposition "$lUrl" -O "$readarrTar"
|
||||||
|
|
||||||
if [ -e "$lInstallDir" ]; then
|
if [ -e "$lInstallDir" ]; then
|
||||||
readarrUpgrade=1
|
readarrUpgrade=1
|
||||||
echoseq " [I] Stopping readarr service"
|
echoseq " [I] Stopping readarr service"
|
||||||
echoseq " Service will not be started automatically after update"
|
echoseq " Service will not be started automatically after update"
|
||||||
exe service readarr stop
|
exe service readarr stop
|
||||||
echoseq " [I] Moving existing $lInstallDir as backup"
|
echoseq " [I] Moving existing $lInstallDir as backup"
|
||||||
exe mv "$lInstallDir" "${lInstallDir}_bu_"`date +%Y%m%d-%H%M%S`
|
exe mv "$lInstallDir" "${lInstallDir}_bu_"`date +%Y%m%d-%H%M%S`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exe tar xvf "$readarrTar" -C "${DLD_DIR}"
|
exe tar xvf "$readarrTar" -C "${DLD_DIR}"
|
||||||
@@ -600,9 +601,9 @@ step_50() {
|
|||||||
local lService=`eval "echo \"$bazarrService\""`
|
local lService=`eval "echo \"$bazarrService\""`
|
||||||
local bazarrVenv="${DLD_DIR}/bazarr"
|
local bazarrVenv="${DLD_DIR}/bazarr"
|
||||||
local bazarrDir="${bazarrVenv}/bazarr"
|
local bazarrDir="${bazarrVenv}/bazarr"
|
||||||
|
|
||||||
local bazarrGitUrl="https://github.com/morpheus65535/bazarr.git"
|
local bazarrGitUrl="https://github.com/morpheus65535/bazarr.git"
|
||||||
|
|
||||||
exe sudo -u $DLD_USER ${bazarrVenv}/bin/pip install --upgrade pip
|
exe sudo -u $DLD_USER ${bazarrVenv}/bin/pip install --upgrade pip
|
||||||
exe sudo -u $DLD_USER ${bazarrVenv}/bin/pip install -r ${bazarrDir}/requirements.txt
|
exe sudo -u $DLD_USER ${bazarrVenv}/bin/pip install -r ${bazarrDir}/requirements.txt
|
||||||
}
|
}
|
||||||
|
@@ -39,12 +39,12 @@ step_1_info() {
|
|||||||
step_1_alias() { ALIAS="backup"; }
|
step_1_alias() { ALIAS="backup"; }
|
||||||
step_1() {
|
step_1() {
|
||||||
shift
|
shift
|
||||||
|
|
||||||
local arg
|
local arg
|
||||||
local retVal
|
local retVal
|
||||||
local dupArgs
|
local dupArgs
|
||||||
local purgeAfter=1
|
local purgeAfter=1
|
||||||
|
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--no-purge|-n)
|
--no-purge|-n)
|
||||||
@@ -65,7 +65,7 @@ step_1() {
|
|||||||
echo " [W] $toolName command \"$1\" not recognized"
|
echo " [W] $toolName command \"$1\" not recognized"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " [I] Running backup profile [$SEQ_PROFILE_NAME]"
|
echo " [I] Running backup profile [$SEQ_PROFILE_NAME]"
|
||||||
|
|
||||||
if [ "${dupArgs[0]}" != "full" ] && [ ! -z "$EBU_MAX_FULLBKP_AGE" ] ; then
|
if [ "${dupArgs[0]}" != "full" ] && [ ! -z "$EBU_MAX_FULLBKP_AGE" ] ; then
|
||||||
@@ -114,10 +114,10 @@ step_5_info() {
|
|||||||
step_5_alias() { ALIAS="restore"; }
|
step_5_alias() { ALIAS="restore"; }
|
||||||
step_5() {
|
step_5() {
|
||||||
shift
|
shift
|
||||||
|
|
||||||
local arg
|
local arg
|
||||||
local restoreOpt
|
local restoreOpt
|
||||||
|
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--file-to-restore|-f)
|
--file-to-restore|-f)
|
||||||
@@ -195,7 +195,7 @@ step_20() {
|
|||||||
if [ ! -z "$1" ] ; then
|
if [ ! -z "$1" ] ; then
|
||||||
ebuTarget="$1"
|
ebuTarget="$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
checkInstalled
|
checkInstalled
|
||||||
exe $toolBin collection-status "$ebuTarget"
|
exe $toolBin collection-status "$ebuTarget"
|
||||||
}
|
}
|
||||||
@@ -208,11 +208,11 @@ step_22() {
|
|||||||
if [ ! -z "$1" ] ; then
|
if [ ! -z "$1" ] ; then
|
||||||
ebuTarget="$1"
|
ebuTarget="$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
checkInstalled
|
checkInstalled
|
||||||
exe $toolBin list-current-files "$ebuTarget"
|
exe $toolBin list-current-files "$ebuTarget"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
step_70_info() {
|
step_70_info() {
|
||||||
echo -n "Manage cron file for "
|
echo -n "Manage cron file for "
|
||||||
@@ -233,7 +233,7 @@ step_70() {
|
|||||||
local cronScript="$toolCronDir/${toolPrefix}$SEQ_PROFILE_NAME"
|
local cronScript="$toolCronDir/${toolPrefix}$SEQ_PROFILE_NAME"
|
||||||
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_PROFILE_NAME"
|
||||||
|
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--remove|-r)
|
--remove|-r)
|
||||||
@@ -248,9 +248,9 @@ step_70() {
|
|||||||
exe touch "$cronLog"
|
exe touch "$cronLog"
|
||||||
exe chmod 600 "$cronLog"
|
exe chmod 600 "$cronLog"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
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_PROFILE_NAME"
|
||||||
exe rm -r "$cronScript"
|
exe rm -r "$cronScript"
|
||||||
|
@@ -116,11 +116,11 @@ step_22() {
|
|||||||
echo " [I] Version $latestVersion is already installed"
|
echo " [I] Version $latestVersion is already installed"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Download
|
# Download
|
||||||
local downUrl="https://github.com/vector-im/element-web/releases/download/v${latestVersion}/element-v${latestVersion}.tar.gz"
|
local downUrl="https://github.com/vector-im/element-web/releases/download/v${latestVersion}/element-v${latestVersion}.tar.gz"
|
||||||
local tempExtract="$tempDown/element-v$latestVersion"
|
local tempExtract="$tempDown/element-v$latestVersion"
|
||||||
|
|
||||||
if [ ! -e "$tempExtract" ] ; then
|
if [ ! -e "$tempExtract" ] ; then
|
||||||
exe mkdir -p "$tempDown"
|
exe mkdir -p "$tempDown"
|
||||||
exe wget -O "$tempLoc" $downUrl
|
exe wget -O "$tempLoc" $downUrl
|
||||||
|
@@ -51,7 +51,7 @@ step_52_info() { echo "Reset freeradius and daloradius database"; }
|
|||||||
step_52_alias() { ALIAS="resetdb"; }
|
step_52_alias() { ALIAS="resetdb"; }
|
||||||
step_52() {
|
step_52() {
|
||||||
local lAnswer
|
local lAnswer
|
||||||
|
|
||||||
if [ $QUIET -eq 0 ]; then
|
if [ $QUIET -eq 0 ]; then
|
||||||
read -p "Do you really want to reset the database $FRAD_DB_NAME y/[n]? " lAnswer
|
read -p "Do you really want to reset the database $FRAD_DB_NAME y/[n]? " lAnswer
|
||||||
else
|
else
|
||||||
|
@@ -103,14 +103,14 @@ step_22() {
|
|||||||
echoerr " [E] Version $latestVersion is already installed"
|
echoerr " [E] Version $latestVersion is already installed"
|
||||||
return 2
|
return 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Download
|
# Download
|
||||||
|
|
||||||
local downUrl="https://files.friendi.ca/friendica-full-${latestVersion}.tar.gz"
|
local downUrl="https://files.friendi.ca/friendica-full-${latestVersion}.tar.gz"
|
||||||
local downUrlAddons="https://files.friendi.ca/friendica-addons-${latestVersion}.tar.gz"
|
local downUrlAddons="https://files.friendi.ca/friendica-addons-${latestVersion}.tar.gz"
|
||||||
local tempExtract="$tempDown/friendica-full-$latestVersion"
|
local tempExtract="$tempDown/friendica-full-$latestVersion"
|
||||||
local tempExtractAddons="$tempDown/friendica-addons-$latestVersion"
|
local tempExtractAddons="$tempDown/friendica-addons-$latestVersion"
|
||||||
|
|
||||||
if [ ! -e "$tempExtract" ] ; then
|
if [ ! -e "$tempExtract" ] ; then
|
||||||
exe mkdir -p "$tempDown"
|
exe mkdir -p "$tempDown"
|
||||||
exe wget -O "$tempLoc" $downUrl
|
exe wget -O "$tempLoc" $downUrl
|
||||||
@@ -132,7 +132,7 @@ step_22() {
|
|||||||
else
|
else
|
||||||
echo " [I] Found existing download: $tempExtractAddons"
|
echo " [I] Found existing download: $tempExtractAddons"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
local tempBu="${FR_LOC}_bu_`date +%Y%m%d-%H%M%S`"
|
local tempBu="${FR_LOC}_bu_`date +%Y%m%d-%H%M%S`"
|
||||||
local tempAddons="${FR_LOC}/addon"
|
local tempAddons="${FR_LOC}/addon"
|
||||||
|
@@ -38,12 +38,12 @@ step_config() {
|
|||||||
|
|
||||||
## Apt cmdline option to suppress user interaction
|
## Apt cmdline option to suppress user interaction
|
||||||
[ $QUIET -ne 0 ] && APTOPT="-y"
|
[ $QUIET -ne 0 ] && APTOPT="-y"
|
||||||
|
|
||||||
if [ -z $giteaVersion ] ; then
|
if [ -z $giteaVersion ] ; then
|
||||||
echoerr " [E] Couldn't determine latest version of $toolName"
|
echoerr " [E] Couldn't determine latest version of $toolName"
|
||||||
fi
|
fi
|
||||||
[ ! -z "$(command -v gitea)" ] && versionNow=$(gitea --version | sed 's/.*version \([0-9.]\+\).*/\1/')
|
[ ! -z "$(command -v gitea)" ] && versionNow=$(gitea --version | sed 's/.*version \([0-9.]\+\).*/\1/')
|
||||||
|
|
||||||
checkArchitecture
|
checkArchitecture
|
||||||
giteaIniLoc="${SEQ_GITEA_CONF_DIR}/app.ini"
|
giteaIniLoc="${SEQ_GITEA_CONF_DIR}/app.ini"
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@ step_1() {
|
|||||||
exe apt install gnupg2 git lsb-release ssl-cert ca-certificates apt-transport-https \
|
exe apt install gnupg2 git lsb-release ssl-cert ca-certificates apt-transport-https \
|
||||||
tree locate software-properties-common dirmngr screen htop nano net-tools zip unzip \
|
tree locate software-properties-common dirmngr screen htop nano net-tools zip unzip \
|
||||||
curl ffmpeg ghostscript libfile-fcntllock-perl curl socat
|
curl ffmpeg ghostscript libfile-fcntllock-perl curl socat
|
||||||
}
|
}
|
||||||
|
|
||||||
step_2_info() { echo "Add universe and official nginx apt repositories"; }
|
step_2_info() { echo "Add universe and official nginx apt repositories"; }
|
||||||
step_2() {
|
step_2() {
|
||||||
@@ -140,6 +140,6 @@ step_20() {
|
|||||||
echo " [I] Restart jitsi-meet components"
|
echo " [I] Restart jitsi-meet components"
|
||||||
exep "service prosody restart&& service jicofo restart && service jitsi-videobridge2 restart"
|
exep "service prosody restart&& service jicofo restart && service jitsi-videobridge2 restart"
|
||||||
}
|
}
|
||||||
|
|
||||||
VERSION_SEQREV=10
|
VERSION_SEQREV=10
|
||||||
. /usr/local/bin/sequencer.sh
|
. /usr/local/bin/sequencer.sh
|
||||||
|
@@ -143,7 +143,7 @@ step_80() {
|
|||||||
cat <<NOTES_EOF
|
cat <<NOTES_EOF
|
||||||
# You can also check LDAP Base DN using the ldapsearch command as shown below
|
# You can also check LDAP Base DN using the ldapsearch command as shown below
|
||||||
ldapsearch -H ldapi:/// -x -LLL -s base -b "" namingContexts
|
ldapsearch -H ldapi:/// -x -LLL -s base -b "" namingContexts
|
||||||
|
|
||||||
# To view the RootDN, run the command below
|
# To view the RootDN, run the command below
|
||||||
ldapsearch -H ldapi:/// -Y EXTERNAL -b "cn=config" "(olcRootDN=*)"
|
ldapsearch -H ldapi:/// -Y EXTERNAL -b "cn=config" "(olcRootDN=*)"
|
||||||
|
|
||||||
|
@@ -218,7 +218,7 @@ step_21_info() { echo "Create $mtaName mysql query files"; }
|
|||||||
step_21() {
|
step_21() {
|
||||||
# eval needed to expand sourced configuration variables
|
# eval needed to expand sourced configuration variables
|
||||||
local localMysqlUser=`eval "echo \"$MAS_VIRTUAL_USER_PART\""`
|
local localMysqlUser=`eval "echo \"$MAS_VIRTUAL_USER_PART\""`
|
||||||
|
|
||||||
exe mkdir -p "$mtaMysqlConfLoc"
|
exe mkdir -p "$mtaMysqlConfLoc"
|
||||||
|
|
||||||
local mtaFile
|
local mtaFile
|
||||||
@@ -230,15 +230,15 @@ step_21() {
|
|||||||
"mysql_virtual_alias_maps"\
|
"mysql_virtual_alias_maps"\
|
||||||
"mysql_virtual_alias_domain_maps"\
|
"mysql_virtual_alias_domain_maps"\
|
||||||
"mysql_virtual_alias_domain_catchall_maps"\
|
"mysql_virtual_alias_domain_catchall_maps"\
|
||||||
)
|
)
|
||||||
|
|
||||||
for mtaFile in ${mtaMysqlFiles[@]}
|
for mtaFile in ${mtaMysqlFiles[@]}
|
||||||
do
|
do
|
||||||
eval 'mtaVar=$MAS_'${mtaFile}
|
eval 'mtaVar=$MAS_'${mtaFile}
|
||||||
echoseq " [I] creating ${mtaFile}.cf"
|
echoseq " [I] creating ${mtaFile}.cf"
|
||||||
exe echo -e "$localMysqlUser\n$mtaVar" > "$mtaMysqlConfLoc/${mtaFile}.cf"
|
exe echo -e "$localMysqlUser\n$mtaVar" > "$mtaMysqlConfLoc/${mtaFile}.cf"
|
||||||
done
|
done
|
||||||
|
|
||||||
exe chown -R root:${mtaUser} "$mtaMysqlConfLoc"
|
exe chown -R root:${mtaUser} "$mtaMysqlConfLoc"
|
||||||
exe chmod 640 "${mtaMysqlConfLoc}"/*
|
exe chmod 640 "${mtaMysqlConfLoc}"/*
|
||||||
}
|
}
|
||||||
@@ -249,7 +249,7 @@ step_22() {
|
|||||||
exe postconf -e "virtual_mailbox_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf"
|
exe postconf -e "virtual_mailbox_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf"
|
||||||
exe postconf -e "virtual_alias_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf"
|
exe postconf -e "virtual_alias_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf"
|
||||||
exe postconf -e "virtual_transport = lmtp:unix:private/dovecot-lmtp"
|
exe postconf -e "virtual_transport = lmtp:unix:private/dovecot-lmtp"
|
||||||
|
|
||||||
# Apex domain removed, it is handled as virtual domain now
|
# Apex domain removed, it is handled as virtual domain now
|
||||||
exe postconf -e "mydestination = \$myhostname, localhost.\$mydomain, localhost"
|
exe postconf -e "mydestination = \$myhostname, localhost.\$mydomain, localhost"
|
||||||
# Base location for the virtual maildirs
|
# Base location for the virtual maildirs
|
||||||
|
@@ -20,7 +20,7 @@ CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
|
|||||||
step_config() {
|
step_config() {
|
||||||
## or to use sequencer api with global config file:
|
## or to use sequencer api with global config file:
|
||||||
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
|
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
|
||||||
|
|
||||||
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
||||||
CONFIG=1
|
CONFIG=1
|
||||||
else
|
else
|
||||||
@@ -75,7 +75,7 @@ step_51() {
|
|||||||
step_52_info() { echo "Create venv and install $toolName"; }
|
step_52_info() { echo "Create venv and install $toolName"; }
|
||||||
step_52() {
|
step_52() {
|
||||||
[ -e "$MACO_BASE_DIR" ] && endReturn -o 1 "$toolName already installed"
|
[ -e "$MACO_BASE_DIR" ] && endReturn -o 1 "$toolName already installed"
|
||||||
|
|
||||||
exe python3 -m venv "$MACO_BASE_DIR"
|
exe python3 -m venv "$MACO_BASE_DIR"
|
||||||
endReturn -o $? "Creating virtual environment failed"
|
endReturn -o $? "Creating virtual environment failed"
|
||||||
|
|
||||||
|
@@ -78,7 +78,7 @@ step_2_info() { echo "Create postgres database for $toolName"; }
|
|||||||
step_2_alias() { ALIAS="createdb"; }
|
step_2_alias() { ALIAS="createdb"; }
|
||||||
step_2() {
|
step_2() {
|
||||||
readDatabaseInfos
|
readDatabaseInfos
|
||||||
|
|
||||||
exe cd ~postgres
|
exe cd ~postgres
|
||||||
exe su -c "psql -c \"CREATE USER ${postgresUser} WITH ENCRYPTED password '${postgresPass}';\"" - postgres
|
exe su -c "psql -c \"CREATE USER ${postgresUser} WITH ENCRYPTED password '${postgresPass}';\"" - postgres
|
||||||
exe su -c "psql -c \"CREATE DATABASE ${postgresDb} ENCODING \"UTF8\" LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER ${postgresUser};\"" - postgres
|
exe su -c "psql -c \"CREATE DATABASE ${postgresDb} ENCODING \"UTF8\" LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER ${postgresUser};\"" - postgres
|
||||||
@@ -154,12 +154,13 @@ SyslogIdentifier=synapse
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target"
|
WantedBy=multi-user.target"
|
||||||
|
|
||||||
step_10_info() { echo -n "Upgrade $toolName installation"
|
step_10_info() {
|
||||||
if [ $CONTEXT_HELP -eq 0 ] ; then
|
echo -n "Upgrade $toolName installation"
|
||||||
echo " at $MATRIX_HOME"
|
if [ $CONTEXT_HELP -eq 0 ] ; then
|
||||||
else
|
echo " at $MATRIX_HOME"
|
||||||
echo
|
else
|
||||||
fi
|
echo
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
step_10_alias() { ALIAS="upgrade"; }
|
step_10_alias() { ALIAS="upgrade"; }
|
||||||
step_10() {
|
step_10() {
|
||||||
@@ -193,7 +194,7 @@ step_14() {
|
|||||||
local synapseIP=localhost
|
local synapseIP=localhost
|
||||||
shift
|
shift
|
||||||
if [ ! -z $1 ]; then
|
if [ ! -z $1 ]; then
|
||||||
synapseIP="$1"
|
synapseIP="$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local apiCall="http://${synapseIP}:8008/_synapse/admin/v1/server_version"
|
local apiCall="http://${synapseIP}:8008/_synapse/admin/v1/server_version"
|
||||||
@@ -215,7 +216,7 @@ step_16() {
|
|||||||
shift
|
shift
|
||||||
local synapseIP=localhost
|
local synapseIP=localhost
|
||||||
local grepOut=" | grep -E '(\"total\":|\"name\":)'"
|
local grepOut=" | grep -E '(\"total\":|\"name\":)'"
|
||||||
|
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-r)
|
-r)
|
||||||
@@ -229,9 +230,9 @@ step_16() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ ! -z $1 ]; then
|
if [ ! -z $1 ]; then
|
||||||
synapseIP="$1"
|
synapseIP="$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local apiCall="http://${synapseIP}:8008/_synapse/admin/v2/users"
|
local apiCall="http://${synapseIP}:8008/_synapse/admin/v2/users"
|
||||||
exep "curl -sS --header \"Authorization: Bearer $MATRIX_ACCESS\" \"$apiCall\" | python -m json.tool $grepOut"
|
exep "curl -sS --header \"Authorization: Bearer $MATRIX_ACCESS\" \"$apiCall\" | python -m json.tool $grepOut"
|
||||||
}
|
}
|
||||||
@@ -285,7 +286,7 @@ step_22() {
|
|||||||
local arg
|
local arg
|
||||||
local synapseIP=localhost
|
local synapseIP=localhost
|
||||||
local grepOut=" | grep -E '(\"total\":|\"name\":|\"room_id\":)'"
|
local grepOut=" | grep -E '(\"total\":|\"name\":|\"room_id\":)'"
|
||||||
|
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-r)
|
-r)
|
||||||
@@ -299,9 +300,9 @@ step_22() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ ! -z $1 ]; then
|
if [ ! -z $1 ]; then
|
||||||
synapseIP="$1"
|
synapseIP="$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local apiCall="http://${synapseIP}:8008/_synapse/admin/v1/rooms"
|
local apiCall="http://${synapseIP}:8008/_synapse/admin/v1/rooms"
|
||||||
exep "curl -sS --header \"Authorization: Bearer $MATRIX_ACCESS\" \"$apiCall\" | python -m json.tool $grepOut"
|
exep "curl -sS --header \"Authorization: Bearer $MATRIX_ACCESS\" \"$apiCall\" | python -m json.tool $grepOut"
|
||||||
}
|
}
|
||||||
@@ -321,7 +322,7 @@ step_24() {
|
|||||||
local roomId=""
|
local roomId=""
|
||||||
local synapseIP=localhost
|
local synapseIP=localhost
|
||||||
local grepOut=" | grep -E '(\"total\":|\"members\":|\"@)'"
|
local grepOut=" | grep -E '(\"total\":|\"members\":|\"@)'"
|
||||||
|
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-r)
|
-r)
|
||||||
@@ -340,9 +341,9 @@ step_24() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z $1 ]; then
|
if [ ! -z $1 ]; then
|
||||||
synapseIP="$1"
|
synapseIP="$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local apiCall="http://${synapseIP}:8008/_synapse/admin/v1/rooms/$roomId/members"
|
local apiCall="http://${synapseIP}:8008/_synapse/admin/v1/rooms/$roomId/members"
|
||||||
exep "curl -sS --header \"Authorization: Bearer $MATRIX_ACCESS\" \"$apiCall\" | python -m json.tool $grepOut"
|
exep "curl -sS --header \"Authorization: Bearer $MATRIX_ACCESS\" \"$apiCall\" | python -m json.tool $grepOut"
|
||||||
}
|
}
|
||||||
@@ -361,14 +362,14 @@ step_26() {
|
|||||||
local i
|
local i
|
||||||
local arg
|
local arg
|
||||||
local synapseIP=localhost
|
local synapseIP=localhost
|
||||||
|
|
||||||
if [ ! -z $1 ]; then
|
if [ ! -z $1 ]; then
|
||||||
synapseIP="$1"
|
synapseIP="$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local apiCall="http://${synapseIP}:8008/_synapse/admin/v1/rooms"
|
local apiCall="http://${synapseIP}:8008/_synapse/admin/v1/rooms"
|
||||||
local arrRoom=( $(curl -sS --header "Authorization: Bearer $MATRIX_ACCESS" "$apiCall" | jq '.rooms[] | select(.joined_local_members == 0) | .room_id') )
|
local arrRoom=( $(curl -sS --header "Authorization: Bearer $MATRIX_ACCESS" "$apiCall" | jq '.rooms[] | select(.joined_local_members == 0) | .room_id') )
|
||||||
|
|
||||||
for i in "${!arrRoom[@]}" ; do
|
for i in "${!arrRoom[@]}" ; do
|
||||||
arrRoom[$i]="${arrRoom[$i]:1:${#arrRoom[$i]}-2}"
|
arrRoom[$i]="${arrRoom[$i]:1:${#arrRoom[$i]}-2}"
|
||||||
done
|
done
|
||||||
@@ -391,7 +392,7 @@ step_28() {
|
|||||||
shift
|
shift
|
||||||
local roomId=""
|
local roomId=""
|
||||||
local synapseIP=localhost
|
local synapseIP=localhost
|
||||||
|
|
||||||
if [ ! -z $1 ]; then
|
if [ ! -z $1 ]; then
|
||||||
roomId="$1"
|
roomId="$1"
|
||||||
shift
|
shift
|
||||||
@@ -434,12 +435,12 @@ step_30() {
|
|||||||
shift
|
shift
|
||||||
local pgVerboseReId=" (VERBOSE) "
|
local pgVerboseReId=" (VERBOSE) "
|
||||||
local pgVerboseVac=" VERBOSE"
|
local pgVerboseVac=" VERBOSE"
|
||||||
|
|
||||||
if [ $VERBOSE == 0 ]; then
|
if [ $VERBOSE == 0 ]; then
|
||||||
pgVerboseReId=" "
|
pgVerboseReId=" "
|
||||||
pgVerboseVac=""
|
pgVerboseVac=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $1 ]; then
|
if [ -z $1 ]; then
|
||||||
readDatabaseInfos
|
readDatabaseInfos
|
||||||
else
|
else
|
||||||
|
@@ -72,7 +72,7 @@ step_4_info() { echo "Create postgres database for $toolName"; }
|
|||||||
step_4_alias() { ALIAS="createdb"; }
|
step_4_alias() { ALIAS="createdb"; }
|
||||||
step_4() {
|
step_4() {
|
||||||
readDatabaseInfos
|
readDatabaseInfos
|
||||||
|
|
||||||
exe cd ~postgres
|
exe cd ~postgres
|
||||||
exe sudo -u postgres psql -c "CREATE USER ${postgresUser} WITH password '${postgresPass}';"
|
exe sudo -u postgres psql -c "CREATE USER ${postgresUser} WITH password '${postgresPass}';"
|
||||||
# -O owner : Specifies the database user who will own the new database.
|
# -O owner : Specifies the database user who will own the new database.
|
||||||
@@ -101,7 +101,7 @@ supervisordConfLoc="/etc/supervisor/conf.d/mayan.conf"
|
|||||||
step_7_info() { echo "Redis configuration file"; }
|
step_7_info() { echo "Redis configuration file"; }
|
||||||
step_7() {
|
step_7() {
|
||||||
addConf -a "$redisConf" "$redisConfLoc"
|
addConf -a "$redisConf" "$redisConfLoc"
|
||||||
|
|
||||||
exe systemctl restart redis
|
exe systemctl restart redis
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ toolScript() {
|
|||||||
if [ ! -z "$1" ] ; then
|
if [ ! -z "$1" ] ; then
|
||||||
readDatabaseInfos
|
readDatabaseInfos
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exep "sudo -u mayan \
|
exep "sudo -u mayan \
|
||||||
MAYAN_DATABASES=\"{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'${postgresDb}','PASSWORD':'${postgresPass}','USER':'${postgresUser}','HOST':'127.0.0.1'}}\" \
|
MAYAN_DATABASES=\"{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'${postgresDb}','PASSWORD':'${postgresPass}','USER':'${postgresUser}','HOST':'127.0.0.1'}}\" \
|
||||||
MAYAN_MEDIA_ROOT=${toolMediaFolder} \
|
MAYAN_MEDIA_ROOT=${toolMediaFolder} \
|
||||||
|
@@ -46,13 +46,13 @@ step_1_info() { echo "Install $toolName dependencies"; }
|
|||||||
step_1_alias() { ALIAS="install"; }
|
step_1_alias() { ALIAS="install"; }
|
||||||
step_1() {
|
step_1() {
|
||||||
local aptOption=
|
local aptOption=
|
||||||
|
|
||||||
local pyVersion=$(python -V 2>&1)
|
local pyVersion=$(python -V 2>&1)
|
||||||
if [[ ! "$pyVersion" =~ \ 2\.[7-9]+ ]] ; then
|
if [[ ! "$pyVersion" =~ \ 2\.[7-9]+ ]] ; then
|
||||||
echoerr " [E] Motioneye requires python version 2.7 but $pyVersion was found."
|
echoerr " [E] Motioneye requires python version 2.7 but $pyVersion was found."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exe apt update
|
exe apt update
|
||||||
endReturn -o $? "Updating apt repositories failed"
|
endReturn -o $? "Updating apt repositories failed"
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ step_3() {
|
|||||||
exe dpkg -i "$motionDownload"
|
exe dpkg -i "$motionDownload"
|
||||||
endReturn -o $? "Installing motion failed"
|
endReturn -o $? "Installing motion failed"
|
||||||
}
|
}
|
||||||
|
|
||||||
step_4_info() { echo "Upgrade python pip"; }
|
step_4_info() { echo "Upgrade python pip"; }
|
||||||
step_4_alias() { ALIAS="upgradepip"; }
|
step_4_alias() { ALIAS="upgradepip"; }
|
||||||
step_4()
|
step_4()
|
||||||
@@ -128,11 +128,11 @@ motioneyeMediaDir="/var/lib/motioneye"
|
|||||||
|
|
||||||
step_8_info() { echo "Create $toolName service"; }
|
step_8_info() { echo "Create $toolName service"; }
|
||||||
step_8() {
|
step_8() {
|
||||||
exe cp "$motioneyeServiceSource" "$motioneyeServiceTarget"
|
exe cp "$motioneyeServiceSource" "$motioneyeServiceTarget"
|
||||||
endReturn -o $? "Creating service failed"
|
endReturn -o $? "Creating service failed"
|
||||||
exe systemctl daemon-reload
|
exe systemctl daemon-reload
|
||||||
exe systemctl enable motioneye
|
exe systemctl enable motioneye
|
||||||
exe systemctl start motioneye
|
exe systemctl start motioneye
|
||||||
}
|
}
|
||||||
motioneyeServiceSource="/usr/local/share/motioneye/extra/motioneye.systemd-unit-local"
|
motioneyeServiceSource="/usr/local/share/motioneye/extra/motioneye.systemd-unit-local"
|
||||||
motioneyeServiceTarget="/etc/systemd/system/motioneye.service"
|
motioneyeServiceTarget="/etc/systemd/system/motioneye.service"
|
||||||
|
@@ -68,7 +68,7 @@ step_10_alias() { ALIAS="createdb"; }
|
|||||||
step_10() {
|
step_10() {
|
||||||
local arg
|
local arg
|
||||||
local dbOption=
|
local dbOption=
|
||||||
|
|
||||||
shift
|
shift
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -84,7 +84,7 @@ step_10() {
|
|||||||
--remote|-r)
|
--remote|-r)
|
||||||
dbRemote="$2"
|
dbRemote="$2"
|
||||||
shift 2 ;;
|
shift 2 ;;
|
||||||
*)
|
*)
|
||||||
break ;;
|
break ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -120,7 +120,7 @@ step_11_info() {
|
|||||||
step_11_alias() { ALIAS="createuser"; }
|
step_11_alias() { ALIAS="createuser"; }
|
||||||
step_11() {
|
step_11() {
|
||||||
local arg
|
local arg
|
||||||
|
|
||||||
shift
|
shift
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -136,7 +136,7 @@ step_11() {
|
|||||||
--remote|-r)
|
--remote|-r)
|
||||||
dbRemote="$2"
|
dbRemote="$2"
|
||||||
shift 2 ;;
|
shift 2 ;;
|
||||||
*)
|
*)
|
||||||
break ;;
|
break ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -172,7 +172,7 @@ step_12_info() {
|
|||||||
step_12_alias() { ALIAS="grant"; }
|
step_12_alias() { ALIAS="grant"; }
|
||||||
step_12() {
|
step_12() {
|
||||||
local arg
|
local arg
|
||||||
|
|
||||||
shift
|
shift
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -188,7 +188,7 @@ step_12() {
|
|||||||
--remote|-r)
|
--remote|-r)
|
||||||
dbRemote="$2"
|
dbRemote="$2"
|
||||||
shift 2 ;;
|
shift 2 ;;
|
||||||
*)
|
*)
|
||||||
break ;;
|
break ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -209,7 +209,7 @@ step_14_info() {
|
|||||||
step_14_alias() { ALIAS="revokeall"; }
|
step_14_alias() { ALIAS="revokeall"; }
|
||||||
step_14() {
|
step_14() {
|
||||||
local arg
|
local arg
|
||||||
|
|
||||||
shift
|
shift
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -219,7 +219,7 @@ step_14() {
|
|||||||
--remote|-r)
|
--remote|-r)
|
||||||
dbRemote="$2"
|
dbRemote="$2"
|
||||||
shift 2 ;;
|
shift 2 ;;
|
||||||
*)
|
*)
|
||||||
break ;;
|
break ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -254,7 +254,7 @@ step_34_info() {
|
|||||||
step_34_alias() { ALIAS="listprivileges"; }
|
step_34_alias() { ALIAS="listprivileges"; }
|
||||||
step_34() {
|
step_34() {
|
||||||
local arg
|
local arg
|
||||||
|
|
||||||
shift
|
shift
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -264,7 +264,7 @@ step_34() {
|
|||||||
--remote|-r)
|
--remote|-r)
|
||||||
dbRemote="$2"
|
dbRemote="$2"
|
||||||
shift 2 ;;
|
shift 2 ;;
|
||||||
*)
|
*)
|
||||||
break ;;
|
break ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -308,7 +308,7 @@ step_50() {
|
|||||||
elif [ ! -e "$2" ]; then
|
elif [ ! -e "$2" ]; then
|
||||||
endReturn -o 1 -f "$2 does not exist"
|
endReturn -o 1 -f "$2 does not exist"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " [I] Dumping database $dbName to $buTarget"
|
echo " [I] Dumping database $dbName to $buTarget"
|
||||||
exep "mysqldump --single-transaction $dbName > \"$(realpath $buTarget)/${dbName}_backup_$(date +%Y%m%d-%H%M%S).sql\""
|
exep "mysqldump --single-transaction $dbName > \"$(realpath $buTarget)/${dbName}_backup_$(date +%Y%m%d-%H%M%S).sql\""
|
||||||
endReturn -o $? "Error creating $dbName backup"
|
endReturn -o $? "Error creating $dbName backup"
|
||||||
|
@@ -41,7 +41,7 @@ step_100_info() {
|
|||||||
step_100_alias() { ALIAS="occ"; }
|
step_100_alias() { ALIAS="occ"; }
|
||||||
step_100() {
|
step_100() {
|
||||||
shift
|
shift
|
||||||
|
|
||||||
exe "${localOcc[@]}" "$@"
|
exe "${localOcc[@]}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ step_102() {
|
|||||||
local ncdb=
|
local ncdb=
|
||||||
local ip=
|
local ip=
|
||||||
local ipregex='^[0-2]*[0-9]{1,2}\.[0-2]*[0-9]{1,2}\.[0-2]*[0-9]{1,2}\.[0-2]*[0-9]{1,2}$'
|
local ipregex='^[0-2]*[0-9]{1,2}\.[0-2]*[0-9]{1,2}\.[0-2]*[0-9]{1,2}\.[0-2]*[0-9]{1,2}$'
|
||||||
|
|
||||||
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 "${WDIR}/mysql.sh" ] ; then
|
||||||
@@ -96,7 +96,7 @@ step_106_alias() { ALIAS="audioscan"; }
|
|||||||
step_106() {
|
step_106() {
|
||||||
shift
|
shift
|
||||||
local ncUser=$1
|
local ncUser=$1
|
||||||
|
|
||||||
if [ -z "$ncUser" ] ; then
|
if [ -z "$ncUser" ] ; then
|
||||||
echoerr " [E] Reset only for single user"
|
echoerr " [E] Reset only for single user"
|
||||||
return 1
|
return 1
|
||||||
|
@@ -19,7 +19,7 @@ CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
|
|||||||
step_config() {
|
step_config() {
|
||||||
## or to use sequencer api with global config file:
|
## or to use sequencer api with global config file:
|
||||||
#initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
|
#initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
|
||||||
|
|
||||||
## or to use sequencer api with profile config file support:
|
## or to use sequencer api with profile config file support:
|
||||||
#initSeqConfig -p "$SCRIPT_NAME" "$CONFIG_FILE_TEMPLATE"
|
#initSeqConfig -p "$SCRIPT_NAME" "$CONFIG_FILE_TEMPLATE"
|
||||||
#if [ $? -eq 0 ] ; then
|
#if [ $? -eq 0 ] ; then
|
||||||
|
@@ -44,7 +44,7 @@ step_config() {
|
|||||||
|
|
||||||
## Apt cmdline option to suppress user interaction
|
## Apt cmdline option to suppress user interaction
|
||||||
[ $QUIET -ne 0 ] && APTOPT="-y"
|
[ $QUIET -ne 0 ] && APTOPT="-y"
|
||||||
|
|
||||||
dockerDnsEntry="DOCKER_OPTS=\"--dns $dockerDns1 --dns $dockerDns2\""
|
dockerDnsEntry="DOCKER_OPTS=\"--dns $dockerDns1 --dns $dockerDns2\""
|
||||||
|
|
||||||
## Return of non zero value will abort the sequence
|
## Return of non zero value will abort the sequence
|
||||||
@@ -119,10 +119,10 @@ step_5() {
|
|||||||
options="-e JWT_ENABLED=true -e JWT_SECRET="
|
options="-e JWT_ENABLED=true -e JWT_SECRET="
|
||||||
# This is the only way to provide SECRET($2) to docker command line which handles all types of characters.
|
# This is the only way to provide SECRET($2) to docker command line which handles all types of characters.
|
||||||
exe docker run -i -t -d -p ${onlyOfficePort}:80 ${options}"$secret" --restart=always \
|
exe docker run -i -t -d -p ${onlyOfficePort}:80 ${options}"$secret" --restart=always \
|
||||||
-v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \
|
-v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \
|
||||||
-v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \
|
-v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \
|
||||||
-v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice \
|
-v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice \
|
||||||
-v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql "${dockerImageName}"
|
-v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql "${dockerImageName}"
|
||||||
else
|
else
|
||||||
echoerr " [W] Running $toolName without JWT (JSON Web Tokens)"
|
echoerr " [W] Running $toolName without JWT (JSON Web Tokens)"
|
||||||
exe docker run -i -t -d -p ${onlyOfficePort}:80 --restart=always "${dockerImageName}"
|
exe docker run -i -t -d -p ${onlyOfficePort}:80 --restart=always "${dockerImageName}"
|
||||||
|
@@ -248,11 +248,11 @@ step_22() {
|
|||||||
echoerr " [E] Version $latestVersion is already installed"
|
echoerr " [E] Version $latestVersion is already installed"
|
||||||
return 2
|
return 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Download
|
# Download
|
||||||
local downUrl="https://github.com/$toolName/$toolName/archive/postfixadmin-${latestVersion}.tar.gz"
|
local downUrl="https://github.com/$toolName/$toolName/archive/postfixadmin-${latestVersion}.tar.gz"
|
||||||
local tempExtract="$tempDown/postfixadmin-postfixadmin-$latestVersion"
|
local tempExtract="$tempDown/postfixadmin-postfixadmin-$latestVersion"
|
||||||
|
|
||||||
if [ ! -e "$tempExtract" ] ; then
|
if [ ! -e "$tempExtract" ] ; then
|
||||||
exe mkdir -p "$tempDown"
|
exe mkdir -p "$tempDown"
|
||||||
exe wget -O "$tempLoc" $downUrl
|
exe wget -O "$tempLoc" $downUrl
|
||||||
|
@@ -49,7 +49,7 @@ postCron="# -q quiet -N timestamping (overwrite existing file) -O target file
|
|||||||
step_3_info() { echo "Configuration notes"; }
|
step_3_info() { echo "Configuration notes"; }
|
||||||
step_3_alias() { ALIAS="notes"; }
|
step_3_alias() { ALIAS="notes"; }
|
||||||
step_3() {
|
step_3() {
|
||||||
echo "$toolNotes"
|
echo "$toolNotes"
|
||||||
}
|
}
|
||||||
toolNotes="
|
toolNotes="
|
||||||
# Reduce default message delay to 1 minute
|
# Reduce default message delay to 1 minute
|
||||||
@@ -75,6 +75,6 @@ step_10_alias() { ALIAS="restart"; }
|
|||||||
step_10() {
|
step_10() {
|
||||||
exe service $toolName restart
|
exe service $toolName restart
|
||||||
}
|
}
|
||||||
|
|
||||||
VERSION_SEQREV=11
|
VERSION_SEQREV=11
|
||||||
. /usr/local/bin/sequencer.sh
|
. /usr/local/bin/sequencer.sh
|
||||||
|
@@ -52,7 +52,7 @@ HDSWAPPUUID=
|
|||||||
|
|
||||||
evalArgs() {
|
evalArgs() {
|
||||||
local argCount=0
|
local argCount=0
|
||||||
|
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-a|--arch)
|
-a|--arch)
|
||||||
@@ -75,7 +75,7 @@ evalArgs() {
|
|||||||
step_1_info() {
|
step_1_info() {
|
||||||
# Shift away args
|
# Shift away args
|
||||||
shift; local lArgs=( "$@" ); evalArgs "${lArgs[@]}"; shift $?
|
shift; local lArgs=( "$@" ); evalArgs "${lArgs[@]}"; shift $?
|
||||||
|
|
||||||
echoinfoArgs "[OPTIONS] [SD CARD DEVICE] [HD DEVICE]"
|
echoinfoArgs "[OPTIONS] [SD CARD DEVICE] [HD DEVICE]"
|
||||||
echo "Download latest Raspberry Pi OS lite image $PIARCH"
|
echo "Download latest Raspberry Pi OS lite image $PIARCH"
|
||||||
if [ $CONTEXT_EXE -ne 0 ]; then
|
if [ $CONTEXT_EXE -ne 0 ]; then
|
||||||
@@ -89,7 +89,7 @@ step_1_alias() { ALIAS="setup"; }
|
|||||||
step_1() {
|
step_1() {
|
||||||
# Shift away args
|
# Shift away args
|
||||||
shift; local lArgs=( "$@" ); evalArgs "${lArgs[@]}"; shift $?
|
shift; local lArgs=( "$@" ); evalArgs "${lArgs[@]}"; shift $?
|
||||||
|
|
||||||
if [ ! -f "$downLoc" ] ; then
|
if [ ! -f "$downLoc" ] ; then
|
||||||
exe wget "$PIDOWNURL" -O "$downLoc"
|
exe wget "$PIDOWNURL" -O "$downLoc"
|
||||||
echo -ne " [I] sha256 sum of download:\n "
|
echo -ne " [I] sha256 sum of download:\n "
|
||||||
@@ -244,7 +244,7 @@ step_4() {
|
|||||||
else
|
else
|
||||||
echo " Replace \"root=PARTUUID=******00-01\" manually"
|
echo " Replace \"root=PARTUUID=******00-01\" manually"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable initial resizing of the second partition
|
# Disable initial resizing of the second partition
|
||||||
echo -n " [I] remove \"init=/usr/lib/raspi-config/init_resize.sh\""
|
echo -n " [I] remove \"init=/usr/lib/raspi-config/init_resize.sh\""
|
||||||
exe sed -i -E "s/[ ]*init=.*\/init_resize\.sh//" "$SDBOOT/cmdline.txt"
|
exe sed -i -E "s/[ ]*init=.*\/init_resize\.sh//" "$SDBOOT/cmdline.txt"
|
||||||
@@ -253,11 +253,11 @@ step_4() {
|
|||||||
else
|
else
|
||||||
echo -e "\n Failed! Remove init=... manually"
|
echo -e "\n Failed! Remove init=... manually"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Save modifications for HD boot
|
# Save modifications for HD boot
|
||||||
exe cp -ar "$SDBOOT"/cmdline.txt "$SDBOOT"/cmdline.txt.hd
|
exe cp -ar "$SDBOOT"/cmdline.txt "$SDBOOT"/cmdline.txt.hd
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Resize second partition of SD to max. possible size
|
# Resize second partition of SD to max. possible size
|
||||||
echo " [I] Resize root partion of SD: ${SDROOT} "
|
echo " [I] Resize root partion of SD: ${SDROOT} "
|
||||||
step resizesd "$SDDEV"
|
step resizesd "$SDDEV"
|
||||||
@@ -357,7 +357,7 @@ read_sd_dev() {
|
|||||||
SDDEV=
|
SDDEV=
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$SDDEV" =~ .*blk.* ]] ; then
|
if [[ "$SDDEV" =~ .*blk.* ]] ; then
|
||||||
partExt="p"
|
partExt="p"
|
||||||
fi
|
fi
|
||||||
@@ -451,7 +451,7 @@ step_22() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
echo " [I] Device to be resized: $SDROOTDEV"
|
echo " [I] Device to be resized: $SDROOTDEV"
|
||||||
|
|
||||||
exe umount -q "$SDROOT"
|
exe umount -q "$SDROOT"
|
||||||
exe parted -s "$SDDEV" "resizepart $SDROOTPARTNO -1" quit
|
exe parted -s "$SDDEV" "resizepart $SDROOTPARTNO -1" quit
|
||||||
saveReturn $?
|
saveReturn $?
|
||||||
@@ -530,7 +530,7 @@ step_31_alias() { ALIAS="disable_wifi"; }
|
|||||||
step_31() {
|
step_31() {
|
||||||
checkBootConfig "$RPI_CONFIG_DTOVERLAY" "$RPI_CONF_DI_WIFI"
|
checkBootConfig "$RPI_CONFIG_DTOVERLAY" "$RPI_CONF_DI_WIFI"
|
||||||
[ $? -eq 0 ] && endReturn -o 1 "Wifi already disabled"
|
[ $? -eq 0 ] && endReturn -o 1 "Wifi already disabled"
|
||||||
|
|
||||||
addConf -a "${RPI_CONFIG_DTOVERLAY}=$RPI_CONF_DI_WIFI" "$RPI_BOOT_CONFIG"
|
addConf -a "${RPI_CONFIG_DTOVERLAY}=$RPI_CONF_DI_WIFI" "$RPI_BOOT_CONFIG"
|
||||||
|
|
||||||
echoseq " [W] Reboot to make changes active"
|
echoseq " [W] Reboot to make changes active"
|
||||||
@@ -560,7 +560,7 @@ step_34() {
|
|||||||
exe sed -i "s/^exit 0/# Turn off tvservice/" "$startScript"
|
exe sed -i "s/^exit 0/# Turn off tvservice/" "$startScript"
|
||||||
exep "echo \"${tvserviceOffCmd}\" >> $startScript"
|
exep "echo \"${tvserviceOffCmd}\" >> $startScript"
|
||||||
exep "echo -e \"\nexit 0\" >> $startScript"
|
exep "echo -e \"\nexit 0\" >> $startScript"
|
||||||
|
|
||||||
echoseq " [W] Reboot to make changes active"
|
echoseq " [W] Reboot to make changes active"
|
||||||
}
|
}
|
||||||
tvserviceBin="/usr/bin/tvservice"
|
tvserviceBin="/usr/bin/tvservice"
|
||||||
|
@@ -74,7 +74,7 @@ step_3() {
|
|||||||
exe read -p "Copy the lines above and press Enter to continue."
|
exe read -p "Copy the lines above and press Enter to continue."
|
||||||
exe vi "$RC_LOC/composer.json"
|
exe vi "$RC_LOC/composer.json"
|
||||||
step postupgrade
|
step postupgrade
|
||||||
|
|
||||||
echo " [I] Generating mysql database $RC_DATABASE"
|
echo " [I] Generating mysql database $RC_DATABASE"
|
||||||
echo
|
echo
|
||||||
exe $WDIR/mysql.sh createdb -c utf8mb4
|
exe $WDIR/mysql.sh createdb -c utf8mb4
|
||||||
@@ -115,7 +115,7 @@ step_10() {
|
|||||||
|
|
||||||
# Install pspell and aspell spell check engine
|
# Install pspell and aspell spell check engine
|
||||||
apt install php7.x-pspell aspell-en aspell-de
|
apt install php7.x-pspell aspell-en aspell-de
|
||||||
|
|
||||||
[$RC_LOC/config/config.inc.php]
|
[$RC_LOC/config/config.inc.php]
|
||||||
\$config['spellcheck_engine'] = 'pspell';
|
\$config['spellcheck_engine'] = 'pspell';
|
||||||
\$config['spellcheck_languages'] = array(
|
\$config['spellcheck_languages'] = array(
|
||||||
@@ -239,7 +239,7 @@ downloadLatest() {
|
|||||||
local downUrl="https://github.com/roundcube/roundcubemail/releases/download/${latestVersion}/roundcubemail-${latestVersion}-complete.tar.gz"
|
local downUrl="https://github.com/roundcube/roundcubemail/releases/download/${latestVersion}/roundcubemail-${latestVersion}-complete.tar.gz"
|
||||||
tempExtract="$tempDown/roundcubemail-$latestVersion"
|
tempExtract="$tempDown/roundcubemail-$latestVersion"
|
||||||
tempInstall="$tempExtract/bin/installto.sh"
|
tempInstall="$tempExtract/bin/installto.sh"
|
||||||
|
|
||||||
if [ ! -e "$tempExtract" ] ; then
|
if [ ! -e "$tempExtract" ] ; then
|
||||||
exe mkdir -p "$tempDown"
|
exe mkdir -p "$tempDown"
|
||||||
exe wget -O "$tempLoc" $downUrl
|
exe wget -O "$tempLoc" $downUrl
|
||||||
|
@@ -35,7 +35,7 @@ step_10_alias() { ALIAS="snmpd"; }
|
|||||||
step_10() {
|
step_10() {
|
||||||
addConf -s -f "$CONFIG_SNMP" "$CONFIG_SNMP_DEST"
|
addConf -s -f "$CONFIG_SNMP" "$CONFIG_SNMP_DEST"
|
||||||
endReturn -o $?
|
endReturn -o $?
|
||||||
|
|
||||||
step checkconf
|
step checkconf
|
||||||
exe service rsyslog restart
|
exe service rsyslog restart
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ step_12_alias() { ALIAS="cron"; }
|
|||||||
step_12() {
|
step_12() {
|
||||||
addConf -s -f "$CONFIG_CRON" "$CONFIG_CRON_DEST"
|
addConf -s -f "$CONFIG_CRON" "$CONFIG_CRON_DEST"
|
||||||
endReturn -o $?
|
endReturn -o $?
|
||||||
|
|
||||||
step checkconf
|
step checkconf
|
||||||
exe service rsyslog restart
|
exe service rsyslog restart
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ step_14_alias() { ALIAS="rngd"; }
|
|||||||
step_14() {
|
step_14() {
|
||||||
addConf -s -f "$CONFIG_RNGD" "$CONFIG_RNGD_DEST"
|
addConf -s -f "$CONFIG_RNGD" "$CONFIG_RNGD_DEST"
|
||||||
endReturn -o $?
|
endReturn -o $?
|
||||||
|
|
||||||
step checkconf
|
step checkconf
|
||||||
exe service rsyslog restart
|
exe service rsyslog restart
|
||||||
}
|
}
|
||||||
|
16
seqs/snmp.sh
16
seqs/snmp.sh
@@ -122,10 +122,10 @@ step_20() {
|
|||||||
exe chmod +x "$rpiExtendLoc"
|
exe chmod +x "$rpiExtendLoc"
|
||||||
|
|
||||||
addConf -a "extend raspberry /etc/snmp/raspberry.sh" "$toolConfig"
|
addConf -a "extend raspberry /etc/snmp/raspberry.sh" "$toolConfig"
|
||||||
|
|
||||||
# VCHI initialization failed fix
|
# VCHI initialization failed fix
|
||||||
exe usermod -aG video ${toolSysUser}
|
exe usermod -aG video ${toolSysUser}
|
||||||
|
|
||||||
addConf -s "$rpiSudoersContent" "$rpiSudoersLoc"
|
addConf -s "$rpiSudoersContent" "$rpiSudoersLoc"
|
||||||
|
|
||||||
exe service snmpd restart
|
exe service snmpd restart
|
||||||
@@ -141,7 +141,7 @@ step_22() {
|
|||||||
if [ "$?" != "0" ]; then
|
if [ "$?" != "0" ]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exe wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/osupdate -O "${osUpdateExtendLoc}"
|
exe wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/osupdate -O "${osUpdateExtendLoc}"
|
||||||
endReturn -o $? "Download failed"
|
endReturn -o $? "Download failed"
|
||||||
exe chmod +x "$osUpdateExtendLoc"
|
exe chmod +x "$osUpdateExtendLoc"
|
||||||
@@ -383,11 +383,11 @@ step_40() {
|
|||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exe wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro -O "${distroExtendLoc}"
|
exe wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro -O "${distroExtendLoc}"
|
||||||
endReturn -o $? "Download distro detection script failed"
|
endReturn -o $? "Download distro detection script failed"
|
||||||
exe chmod +x "$distroExtendLoc"
|
exe chmod +x "$distroExtendLoc"
|
||||||
|
|
||||||
echoseq " [I] Create distro extend"
|
echoseq " [I] Create distro extend"
|
||||||
addConf -a "extend distro ${distroExtendLoc}" "$toolConfig"
|
addConf -a "extend distro ${distroExtendLoc}" "$toolConfig"
|
||||||
|
|
||||||
@@ -415,13 +415,13 @@ step_42() {
|
|||||||
exe wget $locExtUrl -O "${locExtLoc}"
|
exe wget $locExtUrl -O "${locExtLoc}"
|
||||||
endReturn -o $? "Download $locExtName script failed"
|
endReturn -o $? "Download $locExtName script failed"
|
||||||
exe chmod +x "$locExtLoc"
|
exe chmod +x "$locExtLoc"
|
||||||
|
|
||||||
echoseq " [I] Create extend for $locExtName"
|
echoseq " [I] Create extend for $locExtName"
|
||||||
addConf -a "extend $locExtName ${locExtLoc}" "$toolConfig"
|
addConf -a "extend $locExtName ${locExtLoc}" "$toolConfig"
|
||||||
|
|
||||||
echoseq " [I] Create config for $locExtName"
|
echoseq " [I] Create config for $locExtName"
|
||||||
addConf -s "$dhcpExtendConfig" "$dhcpExtendConfigLoc"
|
addConf -s "$dhcpExtendConfig" "$dhcpExtendConfigLoc"
|
||||||
|
|
||||||
echo " [W] Adapt config $dhcpExtendConfigLoc manually and restart snmpd"
|
echo " [W] Adapt config $dhcpExtendConfigLoc manually and restart snmpd"
|
||||||
}
|
}
|
||||||
dhcpExtendConfigLoc="${toolConfigLoc}/dhcp.json"
|
dhcpExtendConfigLoc="${toolConfigLoc}/dhcp.json"
|
||||||
@@ -530,7 +530,7 @@ checkExtend() {
|
|||||||
if [ $? -eq 0 ] && [ $DRY -eq 0 ] ; then
|
if [ $? -eq 0 ] && [ $DRY -eq 0 ] ; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -110,7 +110,7 @@ notes='
|
|||||||
imapsieve_mailbox2_from = Spam
|
imapsieve_mailbox2_from = Spam
|
||||||
imapsieve_mailbox2_causes = COPY
|
imapsieve_mailbox2_causes = COPY
|
||||||
imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve-pipe/report-ham.sieve
|
imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve-pipe/report-ham.sieve
|
||||||
|
|
||||||
sieve_extensions = +notify +imapflags +vnd.dovecot.execute
|
sieve_extensions = +notify +imapflags +vnd.dovecot.execute
|
||||||
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
|
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ notes='
|
|||||||
if environment :matches "imap.user" "*" {
|
if environment :matches "imap.user" "*" {
|
||||||
set "username" "${1}";
|
set "username" "${1}";
|
||||||
pipe :copy "sa-learn-spam.sh" [ "${username}" ];
|
pipe :copy "sa-learn-spam.sh" [ "${username}" ];
|
||||||
|
|
||||||
[/usr/lib/dovecot/sieve-pipe/report-ham.sieve]
|
[/usr/lib/dovecot/sieve-pipe/report-ham.sieve]
|
||||||
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];
|
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];
|
||||||
if environment :matches "imap.mailbox" "*" {
|
if environment :matches "imap.mailbox" "*" {
|
||||||
@@ -136,7 +136,7 @@ notes='
|
|||||||
set "username" "${1}";
|
set "username" "${1}";
|
||||||
}
|
}
|
||||||
pipe :copy "sa-learn-ham.sh" [ "${username}" ];
|
pipe :copy "sa-learn-ham.sh" [ "${username}" ];
|
||||||
|
|
||||||
[/usr/lib/dovecot/sieve-pipe/sa-learn-spam.sh]
|
[/usr/lib/dovecot/sieve-pipe/sa-learn-spam.sh]
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# sa-learn is used in parallel. Be aware of system resources when
|
# sa-learn is used in parallel. Be aware of system resources when
|
||||||
|
@@ -189,7 +189,7 @@ parseList() {
|
|||||||
endReturn -f "Stop on first error"
|
endReturn -f "Stop on first error"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
((line++))
|
((line++))
|
||||||
done 3<"$1"
|
done 3<"$1"
|
||||||
echoseq " [I] Parsed $((--line)) lines"
|
echoseq " [I] Parsed $((--line)) lines"
|
||||||
|
@@ -127,7 +127,7 @@ step_30() {
|
|||||||
echoerr " [E] Backup failed. Aborting upgrade."
|
echoerr " [E] Backup failed. Aborting upgrade."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " [I] Upgrading data"
|
echo " [I] Upgrading data"
|
||||||
exe mv "$toolConfigLoc/lib" "$toolConfigLoc/lib_bu"
|
exe mv "$toolConfigLoc/lib" "$toolConfigLoc/lib_bu"
|
||||||
exe cp -ar "$gitLibLoc/lib" "$toolConfigLoc/"
|
exe cp -ar "$gitLibLoc/lib" "$toolConfigLoc/"
|
||||||
|
@@ -24,7 +24,7 @@ step_1() {
|
|||||||
shift
|
shift
|
||||||
local osRelease=$1
|
local osRelease=$1
|
||||||
endCheckEmpty osRelease "Debian release not provided"
|
endCheckEmpty osRelease "Debian release not provided"
|
||||||
|
|
||||||
echoseq " [I] Setup apt source for $serverName $serverSourceUrl"
|
echoseq " [I] Setup apt source for $serverName $serverSourceUrl"
|
||||||
local srvSource="deb $serverSourceUrl $osRelease nginx"
|
local srvSource="deb $serverSourceUrl $osRelease nginx"
|
||||||
addConf -s "$srvSource" "$serverSourceLoc"
|
addConf -s "$srvSource" "$serverSourceLoc"
|
||||||
@@ -82,8 +82,10 @@ listen 80 default_server;
|
|||||||
include ${snippetLetsencryptLoc};
|
include ${snippetLetsencryptLoc};
|
||||||
}"
|
}"
|
||||||
|
|
||||||
step_4_info() { echo "Installation of $phpName packages:"
|
step_4_info() {
|
||||||
echoinfo "$phpPackages"; }
|
echo "Installation of $phpName packages:"
|
||||||
|
echoinfo "$phpPackages"
|
||||||
|
}
|
||||||
step_4_alias() { ALIAS="php"; }
|
step_4_alias() { ALIAS="php"; }
|
||||||
step_4() {
|
step_4() {
|
||||||
exe apt install $(eval echo $phpPackages) $aptOpt
|
exe apt install $(eval echo $phpPackages) $aptOpt
|
||||||
@@ -142,7 +144,7 @@ step_5() {
|
|||||||
exe sed -i "s|;emergency_restart_threshold.*|emergency_restart_threshold = 10|g" "$phpFpmIniLocation"
|
exe sed -i "s|;emergency_restart_threshold.*|emergency_restart_threshold = 10|g" "$phpFpmIniLocation"
|
||||||
exe sed -i "s|;emergency_restart_interval.*|emergency_restart_interval = 1m|g" "$phpFpmIniLocation"
|
exe sed -i "s|;emergency_restart_interval.*|emergency_restart_interval = 1m|g" "$phpFpmIniLocation"
|
||||||
exe sed -i "s|;process_control_timeout.*|process_control_timeout = 10|g" "$phpFpmIniLocation"
|
exe sed -i "s|;process_control_timeout.*|process_control_timeout = 10|g" "$phpFpmIniLocation"
|
||||||
|
|
||||||
addConf -a "" "$phpPoolConfigLocation"
|
addConf -a "" "$phpPoolConfigLocation"
|
||||||
exe sed -i "s/;env\[HOSTNAME\] = /env[HOSTNAME] = /" "$phpPoolConfigLocation"
|
exe sed -i "s/;env\[HOSTNAME\] = /env[HOSTNAME] = /" "$phpPoolConfigLocation"
|
||||||
exe sed -i "s/;env\[TMP\] = /env[TMP] = /" "$phpPoolConfigLocation"
|
exe sed -i "s/;env\[TMP\] = /env[TMP] = /" "$phpPoolConfigLocation"
|
||||||
|
@@ -6,8 +6,10 @@ phpVersion="7.3"
|
|||||||
phpName="php$phpVersion"
|
phpName="php$phpVersion"
|
||||||
phpPackages="${phpName}-fpm ${phpName}-json ${phpName}-mysql ${phpName}-curl ${phpName}-intl ${phpName}-gd ${phpName}-zip ${phpName}-xml ${phpName}-mbstring php-imagick php-apcu"
|
phpPackages="${phpName}-fpm ${phpName}-json ${phpName}-mysql ${phpName}-curl ${phpName}-intl ${phpName}-gd ${phpName}-zip ${phpName}-xml ${phpName}-mbstring php-imagick php-apcu"
|
||||||
|
|
||||||
step_1_info() { echo "Installation of $serverName packages:"
|
step_1_info() {
|
||||||
echoinfo "$serverPackages"; }
|
echo "Installation of $serverName packages:"
|
||||||
|
echoinfo "$serverPackages"
|
||||||
|
}
|
||||||
step_1_alias() { ALIAS="install"; }
|
step_1_alias() { ALIAS="install"; }
|
||||||
step_1() {
|
step_1() {
|
||||||
exe apt update
|
exe apt update
|
||||||
@@ -19,16 +21,16 @@ step_2_info() { echo "Basic nginx configuration for initial letsencrypt certific
|
|||||||
step_2() {
|
step_2() {
|
||||||
# Writing acme-challenge code snipped for certbot web root authentication
|
# Writing acme-challenge code snipped for certbot web root authentication
|
||||||
addConf -c "$snippetLetsencrypt" "$snippetLetsencryptLoc"
|
addConf -c "$snippetLetsencrypt" "$snippetLetsencryptLoc"
|
||||||
|
|
||||||
# Writing minimal default (see below)
|
# Writing minimal default (see below)
|
||||||
addConf -c "$siteDefaultIp4" "$siteDefaultLoc"
|
addConf -c "$siteDefaultIp4" "$siteDefaultLoc"
|
||||||
|
|
||||||
# try fix errors on first install attempt
|
# try fix errors on first install attempt
|
||||||
# (possible missing ipv6 support on system)
|
# (possible missing ipv6 support on system)
|
||||||
if [ $ERNO -ne 0 ] ; then
|
if [ $ERNO -ne 0 ] ; then
|
||||||
exe apt install nginx
|
exe apt install nginx
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create webroot
|
# create webroot
|
||||||
exe mkdir -p "$siteLetsencryptWww"
|
exe mkdir -p "$siteLetsencryptWww"
|
||||||
|
|
||||||
@@ -50,8 +52,10 @@ siteDefaultIp4="server {
|
|||||||
include ${snippetLetsencryptLoc};
|
include ${snippetLetsencryptLoc};
|
||||||
}"
|
}"
|
||||||
|
|
||||||
step_3_info() { echo "Installation of $phpName packages:"
|
step_3_info() {
|
||||||
echoinfo "$phpPackages"; }
|
echo "Installation of $phpName packages:"
|
||||||
|
echoinfo "$phpPackages"
|
||||||
|
}
|
||||||
step_3() {
|
step_3() {
|
||||||
exe apt install $phpPackages
|
exe apt install $phpPackages
|
||||||
endReturn -o $? "$phpName error during startup"
|
endReturn -o $? "$phpName error during startup"
|
||||||
|
@@ -13,14 +13,14 @@ CONFIG_FILE_NAME="${toolName}.cfg"
|
|||||||
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
|
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
|
||||||
|
|
||||||
#step_config() {
|
#step_config() {
|
||||||
#echo "Called once before executing steps."
|
#echo "Called once before executing steps."
|
||||||
## e.g. to source a config file manually:
|
## e.g. to source a config file manually:
|
||||||
#. "$CONFIG_FILE"
|
#. "$CONFIG_FILE"
|
||||||
## or to use sequencer api:
|
## or to use sequencer api:
|
||||||
#initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
|
#initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
|
||||||
#if [ $? -eq 0 ] ; then
|
#if [ $? -eq 0 ] ; then
|
||||||
# CONFIG=1
|
# CONFIG=1
|
||||||
#fi
|
#fi
|
||||||
#}
|
#}
|
||||||
|
|
||||||
step_1_info() { echo "Prepare installation of $toolName"; }
|
step_1_info() { echo "Prepare installation of $toolName"; }
|
||||||
|
Reference in New Issue
Block a user