Adjusted mounting shares/volumes

This commit is contained in:
2Shirt 2018-11-26 18:14:06 -07:00
parent b3b821a868
commit bb23d49833
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
3 changed files with 4 additions and 9 deletions

View file

@ -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)

View file

@ -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.')

View file

@ -18,6 +18,4 @@ if udevil mount $DEVICE; then
else
echo "Failed"
fi
sleep 2s
exit 0