From bb23d49833e90c58dbc852cf709925d175b0b8ca Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 26 Nov 2018 18:14:06 -0700 Subject: [PATCH] Adjusted mounting shares/volumes --- .bin/Scripts/functions/data.py | 9 +++------ .bin/Scripts/mount-backup-shares | 2 +- .bin/Scripts/remount-rw | 2 -- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.bin/Scripts/functions/data.py b/.bin/Scripts/functions/data.py index 029c674b..9557ebdb 100644 --- a/.bin/Scripts/functions/data.py +++ b/.bin/Scripts/functions/data.py @@ -372,12 +372,9 @@ def mount_network_share(server, read_write=False): username = server['User'] password = server['Pass'] if psutil.WINDOWS: - cmd = r'net use \\{ip}\{share} /user:{username} {password}'.format( - ip = server['IP'], - share = server['Share'], - username = username, - password = password) - cmd = cmd.split(' ') + cmd = [ + 'net', 'use', r'\\{IP}\{Share}'.format(**server), + '/user:{}'.format(username), password] warning = r'Failed to mount \\{Name}\{Share}, {IP} unreachable.'.format( **server) error = r'Failed to mount \\{Name}\{Share} ({IP})'.format(**server) diff --git a/.bin/Scripts/mount-backup-shares b/.bin/Scripts/mount-backup-shares index 9706a0a5..9f3612b6 100755 --- a/.bin/Scripts/mount-backup-shares +++ b/.bin/Scripts/mount-backup-shares @@ -22,7 +22,7 @@ if __name__ == '__main__': # Mount if is_connected(): - mount_backup_shares() + mount_backup_shares(read_write=True) else: # Couldn't connect print_error('ERROR: No network connectivity.') diff --git a/.bin/Scripts/remount-rw b/.bin/Scripts/remount-rw index 4a0b833e..1ba4b41d 100755 --- a/.bin/Scripts/remount-rw +++ b/.bin/Scripts/remount-rw @@ -18,6 +18,4 @@ if udevil mount $DEVICE; then else echo "Failed" fi - -sleep 2s exit 0