8
8
true
9
9
# see https://github.com/koalaman/shellcheck/wiki/Directive
10
10
11
+ # #### LEGACY #####
12
+ # # Remove 2022-09-01
13
+ NCPASS=nextcloud
14
+ NCUSER=ncadmin
15
+ PGDB_USER=nextcloud_db_user
16
+ NCCONFIGDBPASS=$( grep ' dbpassword "$NCPATH"/config/config.php | awk ' {print $3 }' | sed "s/[' ,]//g" )"
17
+ NCCONFIGDB=$( grep ' dbname' " $NCPATH " /config/config.php | awk ' {print $3}' | sed " s/[',]//g" ) "
18
+
19
+
11
20
## VARIABLES
12
21
13
22
# Dirs
@@ -41,7 +50,7 @@ gen_passwd() {
41
50
DISTRO=$( lsb_release -sr)
42
51
KEYBOARD_LAYOUT=$( localectl status | grep " Layout" | awk ' {print $3}' )
43
52
# Hypervisor
44
- # HYPERVISOR=$(dmesg --notime | grep -i hypervisor | cut -d ':' -f2 | head -1 | tr -d ' ') TODO
53
+ ### TODO ### HYPERVISOR=$( dmesg --notime | grep -i hypervisor | cut -d ' :' -f2 | head -1 | tr -d ' ' )
45
54
SYSVENDOR=$( cat /sys/devices/virtual/dmi/id/sys_vendor)
46
55
# Network
47
56
IFACE=$( ip r | grep " default via" | awk ' {print $5}' )
@@ -103,8 +112,8 @@ GEOBLOCKDAT="$GITHUB_REPO/geoblockdat"
103
112
NCREPO=" https://download.nextcloud.com/server/releases"
104
113
ISSUES=" https://github.com/nextcloud/vm/issues"
105
114
# User information
106
- NCPASS=nextcloud
107
- NCUSER=ncadmin
115
+ GUIUSER=ncadmin
116
+ GUIPASS=nextcloud
108
117
UNIXUSER=$SUDO_USER
109
118
UNIXUSER_PROFILE=" /home/$UNIXUSER /.bash_profile"
110
119
ROOT_PROFILE=" /root/.bash_profile"
@@ -113,16 +122,16 @@ BITWARDEN_USER=bitwarden
113
122
BITWARDEN_HOME=/home/" $BITWARDEN_USER "
114
123
# Database
115
124
SHUF=$( shuf -i 25-29 -n 1)
125
+ PGDB_USER=nextcloud_db_user
116
126
PGDB_PASS=$( gen_passwd " $SHUF " " a-zA-Z0-9@#*" )
117
127
NEWPGPASS=$( gen_passwd " $SHUF " " a-zA-Z0-9@#*" )
118
128
ncdb() {
119
- NCCONFIGDB =$( grep " dbname" $NCPATH /config/config.php | awk ' {print $3}' | sed " s/[',]//g" )
120
- }
121
- [ -n " $NCDB " ] && ncdb # TODO: remove this line someday
122
- ncdbpass () {
123
- NCCONFIGDBPASS =$( grep " dbpassword " $NCPATH /config/config.php | awk ' {print $3}' | sed " s/[',]//g" )
129
+ NCDB =$( grep " dbname" $NCPATH /config/config.php | awk ' {print $3}' | sed " s/[',]//g" )
130
+ NCDBPASS= $( grep " dbpassword " $NCPATH /config/config.php | awk ' {print $3} ' | sed " s/[',]//g " )
131
+ NCDBUSER= $( grep " dbuser " $NCPATH /config/config.php | awk ' {print $3} ' | sed " s/[',]//g " )
132
+ NCDBTYPE= $( grep " dbtype " /var/www/nextcloud/config/config.php | awk ' {print $3} ' | sed " s/[',]//g " )
133
+ NCDBHOST =$( grep " dbhost " /var/www/nextcloud /config/config.php | awk ' {print $3}' | sed " s/[',]//g" )
124
134
}
125
- [ -n " $NCDBPASS " ] && ncdbpass # TODO: remove this line someday
126
135
# Path to specific files
127
136
SECURE=" $SCRIPTS /setup_secure_permissions_nextcloud.sh"
128
137
# Nextcloud version
@@ -134,7 +143,6 @@ nc_update() {
134
143
NCBAD=$(( NCMAJOR- 2 ))
135
144
NCNEXT=" $(( ${CURRENTVERSION%% .* } + 1 )) "
136
145
}
137
- [ -n " $NC_UPDATE " ] && nc_update # TODO: remove this line someday
138
146
# Set the hour for automatic updates. This would be 18:00 as only the hour is configurable.
139
147
AUT_UPDATES_TIME=" 18"
140
148
# Keys
@@ -151,7 +159,7 @@ HTTP_CONF="nextcloud_http_domain_self_signed.conf"
151
159
HTTPS_CONF=" $SITES_AVAILABLE /$SUBDOMAIN .conf"
152
160
HTTP2_CONF=" /etc/apache2/mods-available/http2.conf"
153
161
# PHP-FPM
154
- PHPVER=7.4
162
+ PHPVER=8.1
155
163
PHP_FPM_DIR=/etc/php/$PHPVER /fpm
156
164
PHP_INI=$PHP_FPM_DIR /php.ini
157
165
PHP_POOL_DIR=$PHP_FPM_DIR /pool.d
@@ -200,7 +208,6 @@ turn_install() {
200
208
NC_SECRET=$( gen_passwd " $SHUF " " a-zA-Z0-9@#*" )
201
209
SIGNALING_SERVER_CONF=/etc/signaling/server.conf
202
210
}
203
- [ -n " $TURN_INSTALL " ] && turn_install # TODO: remove this line someday
204
211
205
212
## FUNCTIONS
206
213
@@ -691,10 +698,10 @@ version(){
691
698
692
699
[[ $2 != " $h " && $2 != " $t " ]]
693
700
}
694
- if ! version 18 .04 " $DISTRO " 20 .04.10
701
+ if ! version 20 .04 " $DISTRO " 22 .04.10
695
702
then
696
703
print_text_in_color " $IRed " " Your current Ubuntu version is $DISTRO but must be between \
697
- 18 .04 - 20 .04.10 to run this script."
704
+ 20 .04 - 22 .04.10 to run this script."
698
705
print_text_in_color " $ICyan " " Please contact us for support upgrading your server:"
699
706
print_text_in_color " $ICyan " " https://www.hanssonit.se/#contact"
700
707
print_text_in_color " $ICyan " " https://shop.hanssonit.se/"
@@ -1020,13 +1027,13 @@ remove_from_trusted_domains() {
1020
1027
1021
1028
check_distro_version () {
1022
1029
# Check Ubuntu version
1023
- if lsb_release -sc | grep -ic " bionic " & > /dev/null || lsb_release -sc | grep -ic " focal " & > /dev/null
1030
+ if lsb_release -sc | grep -ic " jammy " & > /dev/null || lsb_release -sc | grep -ic " bionic " & > /dev/null
1024
1031
then
1025
1032
OS=1
1026
1033
elif lsb_release -i | grep -ic " Ubuntu" & > /dev/null
1027
1034
then
1028
1035
OS=1
1029
- elif uname -a | grep -ic " bionic " & > /dev/null || uname -a | grep -ic " focal " & > /dev/null
1036
+ elif uname -a | grep -ic " jammy " & > /dev/null || uname -a | grep -ic " bionic " & > /dev/null
1030
1037
then
1031
1038
OS=1
1032
1039
elif uname -v | grep -ic " Ubuntu" & > /dev/null
@@ -1043,8 +1050,8 @@ You can find the download link here: https://www.ubuntu.com/download/server"
1043
1050
exit 1
1044
1051
fi
1045
1052
1046
- if ! version 18 .04 " $DISTRO " 20 .04.10; then
1047
- msg_box " Your current Ubuntu version is $DISTRO but must be between 18 .04 - 20 .04.10 to run this script."
1053
+ if ! version 20 .04.10 " $DISTRO " 22 .04.10; then
1054
+ msg_box " Your current Ubuntu version is $DISTRO but must be between 20 .04 - 22 .04.10 to run this script."
1048
1055
msg_box " Please contact us to get support for upgrading your server:
1049
1056
https://www.hanssonit.se/#contact
1050
1057
https://shop.hanssonit.se/"
@@ -1096,7 +1103,7 @@ then
1096
1103
1097
1104
To bypass this check, comment out (add # before the line) 'ram_check X' in the script that you are trying to run.
1098
1105
1099
- In nextcloud_install_production.sh you can find the check somewhere around line #98 .
1106
+ In nextcloud_install_production.sh you can find the check somewhere around line #48 .
1100
1107
1101
1108
Please note this may affect performance. USE AT YOUR OWN RISK!"
1102
1109
exit 1
@@ -1169,7 +1176,7 @@ version(){
1169
1176
1170
1177
[[ $2 != " $h " && $2 != " $t " ]]
1171
1178
}
1172
- if version 18 .04 " $DISTRO " 20 .04.10
1179
+ if version 20 .04 " $DISTRO " 22 .04.10
1173
1180
then
1174
1181
print_text_in_color " $ICyan " " Testing if network is OK..."
1175
1182
if site_200 github.com
@@ -1194,7 +1201,7 @@ then
1194
1201
fi
1195
1202
fi
1196
1203
else
1197
- msg_box " Your current Ubuntu version is $DISTRO but must be between 18 .04 - 20 .04.10 to run this script."
1204
+ msg_box " Your current Ubuntu version is $DISTRO but must be between 20 .04 - 22 .04.10 to run this script."
1198
1205
msg_box " Please contact us to get support for upgrading your server:
1199
1206
https://www.hanssonit.se/#contact
1200
1207
https://shop.hanssonit.se/"
0 commit comments