From e44716381c9ac56a9eb65b062e29ae10d9c96be4 Mon Sep 17 00:00:00 2001 From: Matthieu Rakotojaona Date: Sun, 19 Jul 2015 23:02:02 +0200 Subject: [PATCH] Unmount when closing application from cli --- cmd/restic/cmd_mount.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/restic/cmd_mount.go b/cmd/restic/cmd_mount.go index d06274d00..01ebe7313 100644 --- a/cmd/restic/cmd_mount.go +++ b/cmd/restic/cmd_mount.go @@ -72,6 +72,10 @@ func (cmd CmdMount) Execute(args []string) error { cmd.global.Printf("Now serving %s at %s\n", repo.Backend().Location(), mountpoint) cmd.global.Printf("Don't forget to umount after quitting!\n") + AddCleanupHandler(func() error { + return systemFuse.Unmount(mountpoint) + }) + cmd.ready <- struct{}{} err = fs.Serve(c, &root)