do a safer migration
This commit is contained in:
parent
5e45d44635
commit
81f97d46e8
@ -87,27 +87,33 @@ sudo rm -f /etc/systemd/system/gohttpserver.service
|
|||||||
sudo rm -f /etc/systemd/system/rustdesksignal.service
|
sudo rm -f /etc/systemd/system/rustdesksignal.service
|
||||||
sudo rm -f /etc/systemd/system/rustdeskrelay.service
|
sudo rm -f /etc/systemd/system/rustdeskrelay.service
|
||||||
|
|
||||||
# We need to create the new install dir before the migration task, otherwise mv will fail
|
|
||||||
mkdir -p "$RUSTDESK_INSTALL_DIR"
|
|
||||||
|
|
||||||
# Migration tasks
|
|
||||||
if [ -d /opt/rustdesk ]
|
|
||||||
then
|
|
||||||
mv /opt/rustdesk/id_* "$RUSTDESK_INSTALL_DIR/"
|
|
||||||
rm -rf /opt/rustdesk
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install Rustdesk again
|
# Install Rustdesk again
|
||||||
# It won't install RustDesk again since there's a check in the install script which checks for the installation folder, but services and everything else will be created
|
# It won't install RustDesk again since there's a check in the install script which checks for the installation folder, but services and everything else will be created
|
||||||
# Would it be possible to move L93-98 after the installation?
|
# Would it be possible to move L93-98 after the installation?
|
||||||
if ! curl -fSLO --retry 3 https://raw.githubusercontent.com/rustdesk/rustdesk-server-pro/main/install.sh
|
if ! curl -fSLO --retry 3 https://raw.githubusercontent.com/rustdesk/rustdesk-server-pro/main/install.sh
|
||||||
msg_box "Sorry, we couldn't fetch the install script, please try again.
|
msg_box "Sorry, we couldn't fetch the install script, please try again.
|
||||||
Your old installation now lives in $RUSTDESK_INSTALL_DIR"
|
Your old installation still lives in /opt/rustdesk"
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
if sudo bash install.sh
|
if sudo bash -x install.sh
|
||||||
then
|
then
|
||||||
rm -f install.sh
|
rm -f install.sh
|
||||||
|
# Migration tasks
|
||||||
|
if [ -d /opt/rustdesk ]
|
||||||
|
then
|
||||||
|
# First remove the keys generated by the installation script
|
||||||
|
rm -f "$RUSTDESK_INSTALL_DIR"/id_*
|
||||||
|
# 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/"
|
||||||
|
then
|
||||||
|
rm -rf /opt/rustdesk
|
||||||
|
else
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
msg_box "Conversion from OS seems to have been OK!"
|
msg_box "Conversion from OS seems to have been OK!"
|
||||||
else
|
else
|
||||||
msg_box "Sorry, but something seems to have gone wrong, please report this to:
|
msg_box "Sorry, but something seems to have gone wrong, please report this to:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user