mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-26 04:47:45 +08:00
mount: if already mounted, unmount before new attempt
This is because if the user specifies that they want to mount multiple times, something must be wrong. try unmounting to reset things and then proceed.
This commit is contained in:
parent
705465db8b
commit
93ad2bd057
@ -98,6 +98,16 @@ baz
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// check if we already have live mounts.
|
||||
// if the user said "Mount", then there must be something wrong.
|
||||
// so, close them and try again.
|
||||
if node.Mounts.Ipfs != nil {
|
||||
node.Mounts.Ipfs.Unmount()
|
||||
}
|
||||
if node.Mounts.Ipns != nil {
|
||||
node.Mounts.Ipns.Unmount()
|
||||
}
|
||||
|
||||
// error if we aren't running node in online mode
|
||||
if node.Network == nil {
|
||||
return nil, errNotOnline
|
||||
|
||||
Loading…
Reference in New Issue
Block a user