Initiate update remotely using SSH?

Is there a script or command that can check for an update, download, and install said update remotely via SSH? I’m setting up Rasplex remotely for a disabled relative and I was hoping to be able to manage it this way.

The GUI obviously is kicking off some code to accomplish these same tasks.

Get the RasPlex-<model>.RP-0.7.1.tar.gz file from https://github.com/RasPlex/RasPlex/releases/tag/0.7.1, unpack KERNEL* and SYSTEM* from the target folder and place them in /storage/.update/.
A reboot later and the device should run RasPlex 0.7.1.

Thanks Kwiboo! Is this a non-destructive update like the GUI update mechanism uses? I have some openvpn files and service I need to remain online or I’ll lose the remote connection completely.

Correct, the GUI update does exactly the same thing, downloads and puts KERNEL* and SYSTEM* in /storage/.update/ and then reboots.