Bump to revision 3

addConf with mandatory paramter; suppots appending
This commit is contained in:
2019-05-17 11:59:51 +01:00
parent 34966ddf79
commit ab10ef6504
11 changed files with 103 additions and 53 deletions

View File

@@ -139,7 +139,7 @@ step_20() {
}
# Sequence Revision
VERSION_SEQREV=2
VERSION_SEQREV=3
# Workaround when called from different directory
# Not needed when path to sequencer is absolut

View File

@@ -46,7 +46,7 @@ step_3() {
step_4_info() { echo "Create systemd service"; }
step_4() {
addConf "$toolServiceContent" "$toolServiceFile"
addConf -c "$toolServiceContent" "$toolServiceFile"
if [ $? -eq 0 ] ; then
exe systemctl daemon reload
@@ -85,7 +85,7 @@ step_5() {
local udevFile="/etc/udev/rules.d/99-kodi.rules"
local inputRule="KERNEL==\"tty[0-9]*\", GROUP=\"tty\", MODE=\"0660\""
addConf "$inputRule" "$udevFile"
addConf -c "$inputRule" "$udevFile"
}
step_6_info() { echo "Increase raspberry pi GPU memory to 320"; }
@@ -127,5 +127,5 @@ step_7() {
esac
}
VERSION_SEQREV=2
VERSION_SEQREV=3
. sequencer.sh

View File

@@ -135,7 +135,7 @@ step_42() {
}
# Sequence Revision
VERSION_SEQREV=2
VERSION_SEQREV=3
# Workaround when called from different directory
# Not needed when path to sequencer is absolut

View File

@@ -4,6 +4,11 @@ toolName="Mayan EDMS"
toolRoot="/opt/mayan-edms"
toolMediaFolder="/opt/mayan-edms/media"
# Needed for different steps
postgresDb=""
postgresUser=""
postgresPass=""
step_1_info() { echo "Install libreoffice without gui"; }
step_1() {
exe apt update
@@ -28,19 +33,11 @@ step_3() {
exe chown -R mayan:mayan ${toolRoot}
}
postgresDb=""
postgresUser=""
postgresPass=""
step_4_info() { echo "Create postgres database for $toolName"; }
step_4_alias() { ALIAS="createdb"; }
step_4() {
exe read -p "Enter postgres database name: " postgresDb
endCheckEmpty postgresDb "database"
exe read -p "Enter postgres user name: " postgresUser
endCheckEmpty postgresUser "user name"
exe read -p "Enter postgres password: " postgresPass
endCheckEmpty postgresPass "password"
readDatabaseInfos
exe sudo -u postgres psql -c "CREATE USER ${postgresUser} WITH password '${postgresPass}';"
# -O owner : Specifies the database user who will own the new database.
exe sudo -u postgres createdb -O ${postgresUser} ${postgresDb}
@@ -55,6 +52,8 @@ step_5() {
saveReturn $?
endReturn
readDatabaseInfos
exe sudo -u mayan MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=${postgresDb} \
MAYAN_DATABASE_PASSWORD="${postgresPass}" MAYAN_DATABASE_USER=${postgresUser} \
MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=${toolMediaFolder} \
@@ -66,11 +65,10 @@ step_5() {
step_6_info() { echo "$toolName configuration file"; }
step_6() {
addConf "$supervisorFile" "$supervisorFileLoc"
exe echo "maxmemory-policy allkeys-lru" >> "$redisConfLoc"
exe echo "save \"\"" >> "$redisConfLoc"
exe echo "databases 1" >> "$redisConfLoc"
readDatabaseInfos
addConf -c "$supervisorFile" "$supervisorFileLoc"
addConf -a "$redisConf" "$redisConfLoc"
exe systemctl restart redis
exe systemctl enable supervisor
@@ -78,6 +76,10 @@ step_6() {
}
redisConfLoc="/etc/redis/redis.conf"
redisConf="\
maxmemory-policy allkeys-lru
save \"\"
databases 1"
supervisorFileLoc="/etc/supervisor/conf.d/mayan.conf"
supervisorFile="\
[supervisord]
@@ -159,5 +161,21 @@ step_22() {
echo " e.g. psql -h 127.0.0.1 -U mayan -d mayan -W -f 2018-06-07_18-10-56.sql"
}
VERSION_SEQREV=2
# Read postgres database information dbname/user/pass if empty
readDatabaseInfos() {
if [ "$postgresDb" == "" ] ; then
read -p "Enter postgres database name: " postgresDb
endCheckEmpty postgresDb "database"
fi
if [ "$postgresUser" == "" ] ; then
read -p "Enter postgres user name: " postgresUser
endCheckEmpty postgresUser "user name"
fi
if [ "$postgresPass" == "" ] ; then
read -p "Enter postgres password: " postgresPass
endCheckEmpty postgresPass "password"
fi
}
VERSION_SEQREV=3
. sequencer.sh

View File

@@ -26,4 +26,7 @@ step_4() {
echo "[ WARN ] Configuration already exists. Doing nothing"
fi
}
VERSION_SEQREV=3
. sequencer.sh

View File

@@ -93,7 +93,7 @@ step_6() {
step_7_info() { echo "Create pixelfed (horzion) service"; }
step_7() {
addConf "${horizonService}" "${horizonServiceLoc}"
addConf -c "${horizonService}" "${horizonServiceLoc}"
exe systemctl daemon-reload
exe systemctl enable pixelfed.service
exe service pixelfed start
@@ -132,7 +132,7 @@ WantedBy=multi-user.target"
step_8_info() { echo "Nginx configuration"; }
step_8() {
addConf "$nginxConfig" "$nginxConfigLoc"
addConf -c "$nginxConfig" "$nginxConfigLoc"
exe ln -s "$nginxConfigLoc" "$nginxConfigEnable"
exe nginx -t
saveReturn $?
@@ -202,7 +202,7 @@ step_22() {
}
# Sequence Revision
VERSION_SEQREV=2
VERSION_SEQREV=3
# Workaround when called from different directory
# Not needed when path to sequencer is absolut

View File

@@ -19,7 +19,7 @@ step_1() {
saveReturn $?
endReturn
addConf "$sourceEntry" "$sourceList"
addConf -c "$sourceEntry" "$sourceList"
}
step_2_info() { echo "Install/Upate $toolName"; }
@@ -51,5 +51,6 @@ step_99() {
endReturn
}
VERSION_SEQREV=2
VERSION_SEQREV=3
. sequencer.sh

View File

@@ -21,10 +21,10 @@ step_1() {
step_2_info() { echo "Basic nginx configuration for initial letsencrypt certificate creation"; }
step_2() {
# Writing acme-challenge code snipped for certbot web root authentication
addConf "$snippetLetsencrypt" "$snippetLetsencryptLoc"
addConf -c "$snippetLetsencrypt" "$snippetLetsencryptLoc"
# Writing minimal default (see below)
addConf "$siteDefaultIp4" "$siteDefaultLoc"
addConf -c "$siteDefaultIp4" "$siteDefaultLoc"
# try fix errors on first install attempt
# (possible missing ipv6 support on system)
@@ -62,7 +62,7 @@ step_3() {
step_4_info() { echo "Mariadb configuration"; }
step_4() {
addConf "$mariadbConfig" "$mariadbConfigLoc"
addConf -c "$mariadbConfig" "$mariadbConfigLoc"
echo -n "Restarting mysql ... "
exe service mysql restart && echo "ok"
@@ -107,8 +107,8 @@ date.timezone = Europe/Berlin"
step_6_info() { echo -e "Configuration of ${phpName} fpm and cli\n"; }
step_6() {
addConf "$phpFpmConfig" "$phpFpmConfigLocation"
addConf "$phpCliConfig" "$phpCliConfigLocation"
addConf -c "$phpFpmConfig" "$phpFpmConfigLocation"
addConf -c "$phpCliConfig" "$phpCliConfigLocation"
echo -n "Restarting ${phpName} ... "
exe service ${phpName}-fpm restart && echo "ok"
@@ -183,5 +183,5 @@ step_12() {
exe mysql -u root -e 'FLUSH PRIVILEGES;'
}
VERSION_SEQREV=2
VERSION_SEQREV=3
. sequencer.sh

View File

@@ -22,10 +22,10 @@ step_1() {
step_2_info() { echo "Basic nginx configuration for initial letsencrypt certificate creation"; }
step_2() {
# Writing acme-challenge code snipped for certbot web root authentication
addConf "$snippetLetsencrypt" "$snippetLetsencryptLoc"
addConf -c "$snippetLetsencrypt" "$snippetLetsencryptLoc"
# Writing minimal default (see below)
addConf "$siteDefaultIp4" "$siteDefaultLoc"
addConf -c "$siteDefaultIp4" "$siteDefaultLoc"
# try fix errors on first install attempt
# (possible missing ipv6 support on system)
@@ -63,7 +63,7 @@ step_3() {
step_4_info() { echo "Mariadb configuration"; }
step_4() {
addConf "$mariadbConfig" "$mariadbConfigLoc"
addConf -c "$mariadbConfig" "$mariadbConfigLoc"
echo -n "Restarting mysql ... "
exe service mysql restart && echo "ok"
@@ -108,8 +108,8 @@ date.timezone = Europe/Berlin"
step_6_info() { echo -e "Configuration of ${phpName} fpm and cli\n"; }
step_6() {
addConf "$phpFpmConfig" "$phpFpmConfigLocation"
addConf "$phpCliConfig" "$phpCliConfigLocation"
addConf -c "$phpFpmConfig" "$phpFpmConfigLocation"
addConf -c "$phpCliConfig" "$phpCliConfigLocation"
echo -n "Restarting ${phpName} ... "
exe service ${phpName}-fpm restart && echo "ok"
@@ -184,5 +184,6 @@ step_12() {
exe mysql -u root -e 'FLUSH PRIVILEGES;'
}
VERSION_SEQREV=2
VERSION_SEQREV=3
. sequencer.sh