Skip to content

22.04 #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
### https://www.techandme.se
### https://www.hanssonit.se/wordpress-vm/

- Ubuntu 20.04 Server
- MariaDB 10.6
- Ubuntu 22.04 Server
- MariaDB 11.0
- NGINX 1.18
- PHP-FPM 7.4
- PHP-FPM 8.1
- Latest Wordpress (updates automatically)
- WP-CLI
- Redis Cache
Expand Down
2 changes: 1 addition & 1 deletion addons/automatic_updates.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059
true
Expand Down
2 changes: 1 addition & 1 deletion addons/locales.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059,1091
true
Expand Down
2 changes: 1 addition & 1 deletion addons/locate_mirror.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059
true
Expand Down
6 changes: 3 additions & 3 deletions addons/redis-server-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SCRIPT_NAME="Redis Server Ubuntu"
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/techandme/wordpress-vm/master/lib.sh)

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# Check for errors + debug code and abort if something isn't right
# 1 = ON
Expand All @@ -17,9 +17,9 @@ debug_mode
root_check

# Check Ubuntu version
if ! version 16.04 "$DISTRO" 20.04.6
if ! version 18.04 "$DISTRO" 22.04.10
then
msg_box "Your current Ubuntu version is $DISTRO but must be between 16.04 - 20.04.6 to run this script."
msg_box "Your current Ubuntu version is $DISTRO but must be between 18.04 - 22.04.10 to run this script."
msg_box "Please contact us to get support for upgrading your server:
https://www.hanssonit.se/#contact
https://shop.hanssonit.se/"
Expand Down
2 changes: 1 addition & 1 deletion addons/smtp-mail.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059
true
Expand Down
2 changes: 1 addition & 1 deletion apps/adminer.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059
true
Expand Down
2 changes: 1 addition & 1 deletion apps/bpytop.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059
true
Expand Down
2 changes: 1 addition & 1 deletion apps/fail2ban.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/
# Inspired by https://github.com/nextcloud/nextcloudpi/blob/master/etc/nextcloudpi-config.d/fail2ban.sh

# shellcheck disable=2034,2059
Expand Down
4 changes: 2 additions & 2 deletions apps/midnight-commander.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# Copyright © 2020 Simon Lindner (https://github.com/szaimen)
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/
# Copyright © 2023 Simon Lindner (https://github.com/szaimen)

# shellcheck disable=2034,2059
true
Expand Down
2 changes: 1 addition & 1 deletion apps/netdata.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059
true
Expand Down
2 changes: 1 addition & 1 deletion apps/webmin.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059
true
Expand Down
2 changes: 1 addition & 1 deletion lets-encrypt/activate-tls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SCRIPT_NAME="Activate TLS"
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/techandme/wordpress-vm/master/lib.sh)

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# Check for errors + debug code and abort if something isn't right
# 1 = ON
Expand Down
2 changes: 1 addition & 1 deletion lets-encrypt/test-new-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SCRIPT_NAME="Test New Configuration"
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/techandme/wordpress-vm/master/lib.sh)

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# Check for errors + debug code and abort if something isn't right
# 1 = ON
Expand Down
26 changes: 15 additions & 11 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ NGINX_CONF="/etc/nginx/nginx.conf"
NGINX_DEF="$SITES_AVAILABLE/default"

# PHP-FPM
PHPVER=7.4
PHPVER=8.1
PHP_FPM_DIR=/etc/php/$PHPVER/fpm
PHP_INI=$PHP_FPM_DIR/php.ini
PHP_POOL_DIR=$PHP_FPM_DIR/pool.d
Expand Down Expand Up @@ -485,10 +485,10 @@ version(){

[[ $2 != "$h" && $2 != "$t" ]]
}
if ! version 18.04 "$DISTRO" 20.04.6
if ! version 20.04 "$DISTRO" 22.04.10
then
print_text_in_color "$IRed" "Your current Ubuntu version is $DISTRO but must be between \
18.04 - 20.04.4 to run this script."
20.04 - 22.04.10 to run this script."
print_text_in_color "$ICyan" "Please contact us to get support for upgrading your server:"
print_text_in_color "$ICyan" "https://www.hanssonit.se/#contact"
print_text_in_color "$ICyan" "https://shop.hanssonit.se/"
Expand Down Expand Up @@ -589,7 +589,7 @@ local tls_alpn_01="certbot certonly --preferred-challenges tls-alpn-01 $default
local dns="certbot certonly --manual --manual-public-ip-logging-ok --preferred-challenges dns $default_le"
local methods=(standalone dns)

for f in ${methods[*]}
for f in "${methods[@]}"
do
print_text_in_color "${ICyan}" "Trying to generate certs and validate them with $f method."
current_method=""
Expand Down Expand Up @@ -711,8 +711,8 @@ You can find the download link here: https://www.ubuntu.com/download/server"
exit 1
fi

if ! version 18.04 "$DISTRO" 20.04.4; then
msg_box "Your current Ubuntu version is $DISTRO but must be between 18.04 - 20.04.4 to run this script."
if ! version 20.04 "$DISTRO" 22.04.10; then
msg_box "Your current Ubuntu version is $DISTRO but must be between 20.04 - 22.04.10 to run this script."
msg_box "Please contact us to get support for upgrading your server:
https://www.hanssonit.se/#contact
https://shop.hanssonit.se/"
Expand Down Expand Up @@ -807,7 +807,7 @@ version(){

[[ $2 != "$h" && $2 != "$t" ]]
}
if version 18.04 "$DISTRO" 20.04.6
if version 20.04 "$DISTRO" 22.04.10
then
print_text_in_color "$ICyan" "Testing if network is OK..."
if ! netplan apply
Expand All @@ -828,7 +828,7 @@ then
fi
fi
else
msg_box "Your current Ubuntu version is $DISTRO but must be between 18.04 - 20.04.6 to run this script."
msg_box "Your current Ubuntu version is $DISTRO but must be between 20.04 - 22.04.6 to run this script."
msg_box "Please contact us to get support for upgrading your server:
https://www.hanssonit.se/#contact
https://shop.hanssonit.se/"
Expand Down Expand Up @@ -1042,9 +1042,13 @@ then
export PHPVER=7.4
elif grep 8.0 <<< "$GETPHP" >/dev/null 2>&1
then
# export PHPVER=8.0
msg_box "Sorry, but PHP 8 is not supported yet."
exit 1
export PHPVER=8.0
elif grep 8.1 <<< "$GETPHP" >/dev/null 2>&1
then
export PHPVER=8.1
elif grep 8.2 <<< "$GETPHP" >/dev/null 2>&1
then
export PHPVER=8.2
fi

export PHP_INI=/etc/php/"$PHPVER"/fpm/php.ini
Expand Down
2 changes: 1 addition & 1 deletion menu/additional_apps.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059
true
Expand Down
2 changes: 1 addition & 1 deletion menu/fail2ban_menu.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2021, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

true
SCRIPT_NAME="Fail2ban Menu"
Expand Down
2 changes: 1 addition & 1 deletion menu/main_menu.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059,1091
true
Expand Down
2 changes: 1 addition & 1 deletion menu/menu.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059,1091
true
Expand Down
2 changes: 1 addition & 1 deletion menu/server_configuration.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059
true
Expand Down
2 changes: 1 addition & 1 deletion menu/startup_configuration.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# shellcheck disable=2034,2059
true
Expand Down
4 changes: 2 additions & 2 deletions network/ddclient-configuration.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# Copyright © 2020 Simon Lindner (https://github.com/szaimen)
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/
# Copyright © 2023 Simon Lindner (https://github.com/szaimen)

# shellcheck disable=2034,2059
true
Expand Down
31 changes: 18 additions & 13 deletions network/static_ip.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# Use local lib file in case there is no internet connection
if printf "Testing internet connection..." && ping github.com -c 2 >/dev/null 2>&1
then
# shellcheck disable=2034,2059
true
SCRIPT_NAME="Static IP"
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/techandme/wordpress-vm/master/lib.sh)
# If we have internet, then use the latest variables from the lib remote file
elif [ -f /var/scripts/lib.sh ]
then
# shellcheck disable=2034,2059
true
SCRIPT_NAME="Static IP"
# shellcheck source=lib.sh
Expand Down Expand Up @@ -167,7 +165,7 @@ Just hit enter to choose the current NS1.\nYour current NS1 is: $DNS1")
done
fi

# Check if DNS is set manaully and set variables accordingly
# Check if DNS is set manually and set variables accordingly
if [ -n "$NSIP1" ]
then
DNSs="$NSIP1"
Expand All @@ -188,15 +186,18 @@ network:
$IFACE: #object name
dhcp4: false # dhcp v4 disable
dhcp6: false # dhcp v6 disable
addresses: [$LANIP] # client IP address
gateway4: $GATEWAYIP # gateway address
addresses:
- $LANIP
routes:
- to: default
via: $GATEWAYIP
nameservers:
addresses: [$DNSs] #name servers
addresses: [$DNSs]
IPCONFIG

msg_box "These are your settings, please make sure they are correct:

$(cat /etc/netplan/01-netcfg.yaml)"
$(cat /etc/netplan/wordpress.yaml)"
netplan try
set_systemd_resolved_dns "$IFACE"
else
Expand All @@ -207,23 +208,27 @@ network:
$IFACE2: #object name
dhcp4: false # dhcp v4 disable
dhcp6: false # dhcp v6 disable
addresses: [$LANIP] # client IP address
gateway4: $GATEWAY # gateway address
addresses:
- $LANIP
routes:
- to: default
via: $GATEWAYIP
nameservers:
addresses: [$DNSs] #name servers
addresses: [$DNSs]
IPCONFIGnonvmware

msg_box "These are your settings, please make sure they are correct:

$(cat /etc/netplan/01-netcfg.yaml)"
$(cat /etc/netplan/wordpress.yaml)"
netplan try
set_systemd_resolved_dns "$IFACE2"
fi

if test_connection
then
sleep 1
msg_box "Static IP sucessfully set!"
msg_box "Static IP successfully set!"
rm -f /etc/netplan/00-installer-config.yaml
break
fi

Expand Down
2 changes: 1 addition & 1 deletion static/adduser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SCRIPT_NAME="Add CLI User"
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/techandme/wordpress-vm/master/lib.sh)

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# Check for errors + debug code and abort if something isn't right
# 1 = ON
Expand Down
2 changes: 1 addition & 1 deletion static/change_db_pass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SCRIPT_NAME="Change Database Password"
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/techandme/wordpress-vm/master/lib.sh)

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

# Check for errors + debug code and abort if something isn't right
# 1 = ON
Expand Down
4 changes: 2 additions & 2 deletions static/wordpress_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ https://shop.hanssonit.se/product/premium-support-per-30-minutes/"
fi
fi

# Ubuntu 16.04 is deprecated
# Ubuntu 18.04 is deprecated
check_distro_version

# Make sure VMLOGS are present
Expand Down Expand Up @@ -75,7 +75,7 @@ then
fi
fi

# Update Redis PHP extension (18.04 --> 20.04 since 16.04 already is deprecated in the top of this script)
# Update Redis PHP extension (20.04 --> 20.04 since 18.04 already is deprecated in the top of this script)
print_text_in_color "$ICyan" "Trying to upgrade the Redis PECL extension..."

# Check current PHP version
Expand Down
2 changes: 1 addition & 1 deletion wordpress-startup-script.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
# T&M Hansson IT AB © - 2023, https://www.hanssonit.se/

#########

Expand Down
Loading