summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmorphlib/exts/ssh-rsync.write5
1 files changed, 5 insertions, 0 deletions
diff --git a/morphlib/exts/ssh-rsync.write b/morphlib/exts/ssh-rsync.write
index 8dc0fe35..509520ae 100755
--- a/morphlib/exts/ssh-rsync.write
+++ b/morphlib/exts/ssh-rsync.write
@@ -59,6 +59,7 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension):
root_disk = self.find_root_disk(location)
version_label = os.environ.get('VERSION_LABEL')
+ autostart = self.get_environment_boolean('AUTOSTART')
self.status(msg='Creating remote mount point')
remote_mnt = cliapp.ssh_runcmd(location, ['mktemp', '-d']).strip()
@@ -110,6 +111,10 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension):
cliapp.ssh_runcmd(location, ['umount', remote_mnt])
cliapp.ssh_runcmd(location, ['rmdir', remote_mnt])
+ if autostart:
+ self.status(msg="Rebooting into new system ...")
+ ssh_runcmd_ignore_failure(location, ['reboot'])
+
def create_remote_orig(self, location, version_root, remote_mnt,
temp_root):
'''Create the subvolume version_root/orig on location'''