Direct path to wrapped fusermount
This commit is contained in:
parent
544b090b58
commit
b9b050fec1
@ -90,13 +90,16 @@ def mountTorrent(magnet):
|
|||||||
print("mounting torrent...")
|
print("mounting torrent...")
|
||||||
umountTorrent()
|
umountTorrent()
|
||||||
os.mkdir(fuseTorrentLocation)
|
os.mkdir(fuseTorrentLocation)
|
||||||
|
|
||||||
|
env = dict(os.environ)
|
||||||
|
env["PATH"] = "/run/wrappers/bin:" + env["PATH"]
|
||||||
o = subprocess.Popen([
|
o = subprocess.Popen([
|
||||||
"btfs",
|
"btfs",
|
||||||
"-o", "auto_unmount", # unmount if process is killed
|
"-o", "auto_unmount", # unmount if process is killed
|
||||||
"-o", "allow_other",
|
|
||||||
"--data-directory=" + btfsDataLocation,
|
"--data-directory=" + btfsDataLocation,
|
||||||
magnet,
|
magnet,
|
||||||
fuseTorrentLocation
|
fuseTorrentLocation,
|
||||||
|
env=env
|
||||||
])
|
])
|
||||||
o.communicate() # wait for it to finish
|
o.communicate() # wait for it to finish
|
||||||
sleep(5) # uhhh I guess I need to sleep?
|
sleep(5) # uhhh I guess I need to sleep?
|
||||||
@ -104,9 +107,12 @@ def mountTorrent(magnet):
|
|||||||
def umountTorrent():
|
def umountTorrent():
|
||||||
print("unmounting torrent...")
|
print("unmounting torrent...")
|
||||||
if os.path.isdir(fuseTorrentLocation):
|
if os.path.isdir(fuseTorrentLocation):
|
||||||
|
env = dict(os.environ)
|
||||||
|
env["PATH"] = "/run/wrappers/bin:" + env["PATH"]
|
||||||
o = subprocess.Popen([
|
o = subprocess.Popen([
|
||||||
"fusermount",
|
"fusermount",
|
||||||
"-u", fuseTorrentLocation
|
"-u", fuseTorrentLocation,
|
||||||
|
env=env
|
||||||
])
|
])
|
||||||
o.communicate() # wait for it to finish
|
o.communicate() # wait for it to finish
|
||||||
os.rmdir(fuseTorrentLocation)
|
os.rmdir(fuseTorrentLocation)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user