Mount CIFS share with read/write permissions (#776)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Gives a dmenu prompt to mount unmounted local NAS shares.
|
# Gives a dmenu prompt to mount unmounted local NAS shares for read/write.
|
||||||
# Requirements - "%wheel ALL=(ALL) NOPASSWD: ALL"
|
# Requirements - "%wheel ALL=(ALL) NOPASSWD: ALL"
|
||||||
#
|
#
|
||||||
# Browse for mDNS/DNS-SD services using the Avahi daemon...
|
# Browse for mDNS/DNS-SD services using the Avahi daemon...
|
||||||
@@ -12,7 +12,7 @@ share2mnt=//"$srvname".local/"$share"
|
|||||||
|
|
||||||
sharemount() {
|
sharemount() {
|
||||||
mounted=$(mount -v | grep "$share2mnt") || ([ ! -d /mnt/"$share" ] && sudo mkdir /mnt/"$share")
|
mounted=$(mount -v | grep "$share2mnt") || ([ ! -d /mnt/"$share" ] && sudo mkdir /mnt/"$share")
|
||||||
[ -z "$mounted" ] && sudo mount -t cifs "$share2mnt" -o user=nobody,password="" /mnt/"$share" && notify-send "Netshare $share mounted" && exit 0
|
[ -z "$mounted" ] && sudo mount -t cifs "$share2mnt" -o user=nobody,password="",noperm /mnt/"$share" && notify-send "Netshare $share mounted" && exit 0
|
||||||
notify-send "Netshare $share already mounted"; exit 1
|
notify-send "Netshare $share already mounted"; exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user