I am trying to update Pagekite (apt package) on remote host.
Pagekite is the package that is giving me the current ssh connection.
After updating the package the service doesn't restart automatically.
If I were on a local computer I would do:
apt-get install pagekite && systemctl start pagekite
Considering that I'm on remote host, after the first command succeeds, there is a broken pipe and the start of the service doesn't happen and I am locked out of the machine.
I tried also the following, which should execute the second command no matter what, but it doesn't look to get executed.
apt-get install pagekite; systemctl start pagekite
How could I do this?
nohup sh -c 'apt-get install pagekite && systemctl start pagekite' > /dev/null &
nohup sh -c allows the system to ignore the hungup signal: after the pagekite is updated the user will get disconnected from the ssh session but the command will keep executing untill the end.