mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-24 06:55:21 -07:00
remove sudo pass option. #1588
This commit is contained in:
parent
d45bc20ff6
commit
667fee339d
3 changed files with 8 additions and 25 deletions
|
@ -32,8 +32,6 @@
|
||||||
safe_mode = 1
|
safe_mode = 1
|
||||||
# Turn this on to disable additional extraction attempts for failed downloads. Default = 0 will attempt to extract and verify if media is present.
|
# Turn this on to disable additional extraction attempts for failed downloads. Default = 0 will attempt to extract and verify if media is present.
|
||||||
no_extract_failed = 0
|
no_extract_failed = 0
|
||||||
# Set the sudo password for any functions that require root permissions (e.g. mounting .iso images for transcoding)
|
|
||||||
sudo_password =
|
|
||||||
|
|
||||||
[Posix]
|
[Posix]
|
||||||
### Process priority setting for External commands (Extractor and Transcoder) on Posix (Unix/Linux/OSX) systems.
|
### Process priority setting for External commands (Extractor and Transcoder) on Posix (Unix/Linux/OSX) systems.
|
||||||
|
|
|
@ -127,7 +127,6 @@ LOG_ENV = None
|
||||||
LOG_GIT = None
|
LOG_GIT = None
|
||||||
SYS_ENCODING = None
|
SYS_ENCODING = None
|
||||||
FAILED = False
|
FAILED = False
|
||||||
SUDO_PASS = None
|
|
||||||
|
|
||||||
AUTO_UPDATE = None
|
AUTO_UPDATE = None
|
||||||
NZBTOMEDIA_VERSION = __version__
|
NZBTOMEDIA_VERSION = __version__
|
||||||
|
@ -366,7 +365,6 @@ def configure_general():
|
||||||
global CHECK_MEDIA
|
global CHECK_MEDIA
|
||||||
global SAFE_MODE
|
global SAFE_MODE
|
||||||
global NOEXTRACTFAILED
|
global NOEXTRACTFAILED
|
||||||
global SUDO_PASS
|
|
||||||
|
|
||||||
# Set Version and GIT variables
|
# Set Version and GIT variables
|
||||||
VERSION_NOTIFY = int(CFG['General']['version_notify'])
|
VERSION_NOTIFY = int(CFG['General']['version_notify'])
|
||||||
|
@ -380,7 +378,6 @@ def configure_general():
|
||||||
CHECK_MEDIA = int(CFG['General']['check_media'])
|
CHECK_MEDIA = int(CFG['General']['check_media'])
|
||||||
SAFE_MODE = int(CFG['General']['safe_mode'])
|
SAFE_MODE = int(CFG['General']['safe_mode'])
|
||||||
NOEXTRACTFAILED = int(CFG['General']['no_extract_failed'])
|
NOEXTRACTFAILED = int(CFG['General']['no_extract_failed'])
|
||||||
SUDO_PASS = CFG['General']['sudo_password']
|
|
||||||
|
|
||||||
|
|
||||||
def configure_updates():
|
def configure_updates():
|
||||||
|
|
|
@ -678,16 +678,10 @@ def mount_iso(item, new_dir, bitbucket): #Currently only supports Linux Mount wh
|
||||||
return []
|
return []
|
||||||
mount_point = os.path.join(os.path.dirname(os.path.abspath(item)),'temp')
|
mount_point = os.path.join(os.path.dirname(os.path.abspath(item)),'temp')
|
||||||
make_dir(mount_point)
|
make_dir(mount_point)
|
||||||
if core.SUDO_PASS:
|
cmd = ['mount', '-o', 'loop', item, mount_point]
|
||||||
cmd = ['sudo', '-S', 'mount', '-o', 'loop', item, mount_point]
|
print_cmd(cmd)
|
||||||
print_cmd(cmd)
|
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=bitbucket)
|
||||||
proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stderr=bitbucket)
|
out, err = proc.communicate()
|
||||||
out, err = proc.communicate(core.SUDO_PASS + '\n')
|
|
||||||
else:
|
|
||||||
cmd = ['mount', '-o', 'loop', item, mount_point]
|
|
||||||
print_cmd(cmd)
|
|
||||||
proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stderr=bitbucket)
|
|
||||||
out, err = proc.communicate()
|
|
||||||
core.MOUNTED = mount_point # Allows us to verify this has been done and then cleanup.
|
core.MOUNTED = mount_point # Allows us to verify this has been done and then cleanup.
|
||||||
for root, dirs, files in os.walk(mount_point):
|
for root, dirs, files in os.walk(mount_point):
|
||||||
for file in files:
|
for file in files:
|
||||||
|
@ -969,16 +963,10 @@ def transcode_directory(dir_name):
|
||||||
final_result = final_result + result
|
final_result = final_result + result
|
||||||
if core.MOUNTED: # In case we mounted an .iso file, unmount here.
|
if core.MOUNTED: # In case we mounted an .iso file, unmount here.
|
||||||
time.sleep(5) # play it safe and avoid failing to unmount.
|
time.sleep(5) # play it safe and avoid failing to unmount.
|
||||||
if core.SUDO_PASS:
|
cmd = ['umount', '-l', core.MOUNTED]
|
||||||
cmd = ['sudo', '-S', 'umount', '-l', core.MOUNTED]
|
print_cmd(cmd)
|
||||||
print_cmd(cmd)
|
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=bitbucket)
|
||||||
proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stderr=bitbucket)
|
out, err = proc.communicate()
|
||||||
out, err = proc.communicate(core.SUDO_PASS + '\n')
|
|
||||||
else:
|
|
||||||
cmd = ['umount', '-l', core.MOUNTED]
|
|
||||||
print_cmd(cmd)
|
|
||||||
proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stderr=bitbucket)
|
|
||||||
out, err = proc.communicate()
|
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
os.rmdir(core.MOUNTED)
|
os.rmdir(core.MOUNTED)
|
||||||
core.MOUNTED = None
|
core.MOUNTED = None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue