be extra careful

This commit is contained in:
Daniel Hansson 2023-10-06 08:18:28 +02:00 committed by GitHub
parent b5801a9bfa
commit 66e8be4176
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,10 +105,15 @@ else
# First remove the keys generated by the installation script # First remove the keys generated by the installation script
rm -f "$RUSTDESK_INSTALL_DIR"/id_* rm -f "$RUSTDESK_INSTALL_DIR"/id_*
# Then copy over the old keys to the new install dir # Then copy over the old keys to the new install dir
# Only remove the old dir if the copy was succesful
if cp -f /opt/rustdesk/id_* "$RUSTDESK_INSTALL_DIR/" if cp -f /opt/rustdesk/id_* "$RUSTDESK_INSTALL_DIR/"
then then
rm -rf /opt/rustdesk # Make sure to really protect the old keys by checking that the new service actually restarts with 0 status before removing the old keys.
if systemctl restart rustdesk-hbbr.service && systemctl restart rustdesk-hbbs.service
then
rm -rf /opt/rustdesk
else
msg_box "Sorry, couldn't restart the new services. Please send your output to https://github.com/rustdesk/rustdesk-server-pro in a new issue."
fi
else else
msg_box "Sorry, but it seems that something went wrong with copying your old keys to the new install dir. Please try again" msg_box "Sorry, but it seems that something went wrong with copying your old keys to the new install dir. Please try again"
exit 1 exit 1