On 11/04/2017 11:12 AM, Loren Tedford wrote:
Hello I know you can do a rm -R /  and completely remove everything on the hard drive remotely and the system will stay up until reboot because i have done this a few times.. Just curious though if its possible to remote reinstall asterisk from the scripts that dial uses? Example dial installation script etc and data etc.. idk just thinking about situations where i might need a hard reset of everything and it would be nice to be able to send some dtmf and do complete restore remotely or ssh in and do a complete restore etc.. Of course i would have to modify things a bit to keep my vpns and stuff in the system but it might be worth a shot..

If you have a disk image of the replacement system handy, you can try some fun with DD over SSH:

dd if=<local disk image/drive> | ssh user@remote dd of=<remote drive>

Example using asterisk.img as an image to write to remote disk /dev/sda:
dd if=asterisk.img | ssh user@remote dd of=/dev/sda

For a status display you can pipe dd through pv.   (You can also try an alternative to dd like dc3dd):
dd if=<local disk image/drive> | pv | ssh user@remote dd of=<remote drive>

Just note that once this completes, you will have a system in a state totally different from what it booted with and things may not play well doing a normal shutdown.

-Stacy
KG7QIN