Backup and restore nginx password hashes
This commit is contained in:
parent
28ce3e0de9
commit
b54314d4b0
|
@ -9266,6 +9266,7 @@ function install_search_engine {
|
|||
|
||||
# an unprivileged user to run as
|
||||
useradd -d ${SEARCH_ENGINE_PATH}/searx/ -s /bin/false searx
|
||||
adduser searx debian-tor
|
||||
|
||||
# daemon
|
||||
echo '[Unit]' > /etc/systemd/system/searx.service
|
||||
|
|
|
@ -451,6 +451,10 @@ function backup_configuration {
|
|||
if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then
|
||||
cp -f $BACKUP_EXTRA_DIRECTORIES /root/tempbackupconfig
|
||||
fi
|
||||
# nginx password hashes
|
||||
if [ -f /etc/nginx/.htpasswd ]; then
|
||||
cp -f /etc/nginx/.htpasswd /root/tempbackupconfig/htpasswd
|
||||
fi
|
||||
backup_directory_to_usb /root/tempbackupconfig config
|
||||
}
|
||||
|
||||
|
|
|
@ -172,6 +172,10 @@ function backup_configuration {
|
|||
if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then
|
||||
cp -f $BACKUP_EXTRA_DIRECTORIES /root/tempbackupconfig
|
||||
fi
|
||||
# nginx password hashes
|
||||
if [ -f /etc/nginx/.htpasswd ]; then
|
||||
cp -f /etc/nginx/.htpasswd /root/tempbackupconfig/htpasswd
|
||||
fi
|
||||
backup_directory_to_friend /root/tempbackupconfig config
|
||||
}
|
||||
|
||||
|
|
|
@ -295,6 +295,11 @@ function restore_configuration {
|
|||
fi
|
||||
fi
|
||||
|
||||
# restore nginx password hashes
|
||||
if [ -f /root/tempconfig/root/htpasswd ]; then
|
||||
cp -f /root/tempconfig/root/htpasswd /etc/nginx/.htpasswd
|
||||
fi
|
||||
|
||||
rm -rf /root/tempconfig
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -205,6 +205,11 @@ function restore_configuration {
|
|||
fi
|
||||
fi
|
||||
|
||||
# restore nginx password hashes
|
||||
if [ -f /root/tempconfig/root/htpasswd ]; then
|
||||
cp -f /root/tempconfig/root/htpasswd /etc/nginx/.htpasswd
|
||||
fi
|
||||
|
||||
rm -rf /root/tempconfig
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue