|
@@ -186,6 +186,29 @@ function restore_database {
|
186
|
186
|
restore_directory_from_usb "/root/temp${1}" "${1}"
|
187
|
187
|
RESTORE_SUBDIR="var"
|
188
|
188
|
if [ ${2} ]; then
|
|
189
|
+ # special handline of ttrss
|
|
190
|
+ if [[ ${2} == "ttrss" ]]; then
|
|
191
|
+ if [ -d /etc/share/${2} ]; then
|
|
192
|
+ if [ -d /root/temp${1}/etc/share/${2} ]; then
|
|
193
|
+ rm -rf /etc/share/${2}
|
|
194
|
+ mv /root/temp${1}/etc/share/${2} /etc/share/
|
|
195
|
+ if [ ! "$?" = "0" ]; then
|
|
196
|
+ unmount_drive
|
|
197
|
+ exit 528
|
|
198
|
+ fi
|
|
199
|
+ if [ -d /etc/letsencrypt/live/${2} ]; then
|
|
200
|
+ ln -s /etc/letsencrypt/live/${2}/privkey.pem /etc/ssl/private/${2}.key
|
|
201
|
+ ln -s /etc/letsencrypt/live/${2}/fullchain.pem /etc/ssl/certs/${2}.pem
|
|
202
|
+ else
|
|
203
|
+ # Ensure that the bundled SSL cert is being used
|
|
204
|
+ if [ -f /etc/ssl/certs/${2}.bundle.crt ]; then
|
|
205
|
+ sed -i "s|${2}.crt|${2}.bundle.crt|g" /etc/nginx/sites-available/${2}
|
|
206
|
+ fi
|
|
207
|
+ fi
|
|
208
|
+ fi
|
|
209
|
+ fi
|
|
210
|
+ fi
|
|
211
|
+
|
189
|
212
|
if [ -d /var/www/${2}/htdocs ]; then
|
190
|
213
|
if [ -d /root/temp${1}/${RESTORE_SUBDIR}/www/${2}/htdocs ]; then
|
191
|
214
|
rm -rf /var/www/${2}/htdocs
|