mirror of
https://github.com/oupala/apaxy.git
synced 2025-08-26 00:54:00 +02:00
fix: make the script apaxy-configure.sh more robust
The script apaxy-configure.sh can now be launched from anywhere in the system, and not only from the `apaxy` directory. This is very useful when the context is managed by another tool, such as ansible.
This commit is contained in:
6
apaxy-configure.sh
Normal file → Executable file
6
apaxy-configure.sh
Normal file → Executable file
@@ -22,6 +22,8 @@ defaultApacheWebRootPath="/var/www/html"
|
|||||||
defaultInstallWebPath=""
|
defaultInstallWebPath=""
|
||||||
defaultEnableGallery=false
|
defaultEnableGallery=false
|
||||||
|
|
||||||
|
workingDirectory="$(dirname "${0}")"
|
||||||
|
|
||||||
# functions
|
# functions
|
||||||
|
|
||||||
###
|
###
|
||||||
@@ -84,8 +86,6 @@ log () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# getting parameters value from config file (can be overloaded by cli values)
|
# getting parameters value from config file (can be overloaded by cli values)
|
||||||
workingDirectory=$(dirname "$0")
|
|
||||||
|
|
||||||
if [ -f "${workingDirectory}/apaxy.config" ]; then
|
if [ -f "${workingDirectory}/apaxy.config" ]; then
|
||||||
# shellcheck source=apaxy.config
|
# shellcheck source=apaxy.config
|
||||||
source "${workingDirectory}/apaxy.config"
|
source "${workingDirectory}/apaxy.config"
|
||||||
@@ -189,7 +189,7 @@ if [ ! -d "${installDir}" ] || [ ! -w "${installDir}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log 1 "- copying apaxy in install directory"
|
log 1 "- copying apaxy in install directory"
|
||||||
cp -r apaxy/* "${installDir}/"
|
cp -r ${workingDirectory}/apaxy/* "${installDir}/"
|
||||||
|
|
||||||
log 1 "- configuring apaxy in install directory"
|
log 1 "- configuring apaxy in install directory"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user