|
96 | 96 | true |
97 | 97 | SCRIPT_NAME="Wordpress startup script" |
98 | 98 | # shellcheck source=lib.sh |
99 | | -source /var/scripts/fetch_lib.sh |
| 99 | +source /var/scripts/fetch_lib.sh |
100 | 100 |
|
101 | 101 | # Check for errors + debug code and abort if something isn't right |
102 | 102 | # 1 = ON |
@@ -152,8 +152,7 @@ msg_box"This script will do the final setup for you |
152 | 152 | - Create a new WP user |
153 | 153 | - Upgrade the system |
154 | 154 | - Activate TLS (Let's Encrypt) |
155 | | -- Install Adminer |
156 | | -- Change system timezone |
| 155 | +- Install different apps of your liking |
157 | 156 | - Set new password to the Linux system (user: wordpress) |
158 | 157 |
|
159 | 158 | ############### T&M Hansson IT AB - $(date +"%Y") ###############" |
@@ -258,8 +257,14 @@ echo "WP PASS: $NEWWPADMINPASS" |
258 | 257 |
|
259 | 258 | # Change servername in Nginx |
260 | 259 | server_name=$(echo "$FQDN" | cut -d "/" -f3) |
261 | | -sed -i "s|# server_name .*|server_name $server_name;|g" "$SITES_ENABLED"/"$HTTP_CONF" |
262 | | -sed -i "s|# server_name .*|server_name $server_name;|g" "$SITES_ENABLED"/"$TLS_CONF" |
| 260 | +if [ -f "$SITES_ENABLED"/"$HTTP_CONF" ] |
| 261 | +then |
| 262 | + sed -i "s|# server_name .*|server_name $server_name;|g" "$SITES_ENABLED"/"$HTTP_CONF" |
| 263 | +fi |
| 264 | +if [ -f "$SITES_ENABLED"/"$TLS_CONF" ] |
| 265 | +then |
| 266 | + sed -i "s|# server_name .*|server_name $server_name;|g" "$SITES_ENABLED"/"$TLS_CONF" |
| 267 | +fi |
263 | 268 | restart_webserver |
264 | 269 |
|
265 | 270 | # Show current administrators |
@@ -344,6 +349,10 @@ LOGIN: |
344 | 349 | Login to Wordpress in your browser: |
345 | 350 | - IP: $ADDRESS |
346 | 351 | - Hostname: $(hostname -f) |
| 352 | +
|
| 353 | +If you get access 'Forbidden' while accessing wp-login.php, please allow your IP in: |
| 354 | +$SITES_ENABLED/your_active.conf |
| 355 | +
|
347 | 356 | ### PLEASE HIT OK TO REBOOT ###" |
348 | 357 |
|
349 | 358 | # Reboot |
|
0 commit comments