File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #!/command/with-contenv bash
2+
3+ DIRS=(
4+ /var/www/files
5+ /var/www/ojs/cache
6+ /var/www/ojs/public
7+ )
8+ echo "Setting OJS permissions..."
9+ for DIR in "${DIRS[@]}"; do
10+ echo "Setting permissions on $DIR"
11+ chown -R nginx:nginx "$DIR"
12+ find "$DIR" -type d -exec chmod 750 {} \;
13+ find "$DIR" -type f -exec chmod 640 {} \;
14+ done
15+ echo "OJS permissions set: dirs=750, files=640"
Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ SET PASSWORD FOR ${DB_USER}@'%' = PASSWORD('${DB_PASSWORD}')
1515EOF
1616}
1717
18+ function set_ojs_installed {
19+ sed -i ' s/installed = Off/installed = On/' /var/www/ojs/config.inc.php
20+ chmod 440 /var/www/ojs/config.inc.php
21+ }
22+
1823function check_ojs_installed {
1924 # Check if OJS database tables exist
2025 # Query the database for one of the core OJS tables (journals table)
@@ -61,8 +66,7 @@ function install_ojs {
6166 cat /tmp/ojs-install.log
6267 echo " =========================================="
6368 fi
64- sed -i ' s/installed = Off/installed = On/' /var/www/ojs/config.inc.php
65- chmod 440 /var/www/ojs/config.inc.php
69+ set_ojs_installed
6670}
6771
6872function main {
@@ -79,6 +83,7 @@ function main {
7983 echo " OJS installation started."
8084 else
8185 echo " OJS is already installed. Skipping installation."
86+ set_ojs_installed
8287 fi
8388}
8489main
You can’t perform that action at this time.
0 commit comments