Initial upload
This commit is contained in:
28
mount-nextcloud
Executable file
28
mount-nextcloud
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
user=ExampleUser
|
||||
server=cloud.example.com
|
||||
account=$user@$server
|
||||
uri=davs://$account/remote.php/webdav
|
||||
uri_esc=$(echo $uri | sed s/\\//\\\\\\//g)
|
||||
online=$(gio mount -l | sed "/^Mount/! d;/$uri_esc/! d" | wc -l)
|
||||
echo $online
|
||||
if [ $online -gt 0 ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
case $XDG_SESSION_TYPE in
|
||||
tty)
|
||||
gio mount $uri </dev/null && exit
|
||||
echo not cached
|
||||
systemd-ask-password Nextcloud password | gio mount $uri;;
|
||||
x11)
|
||||
gio mount $uri </dev/null && exit
|
||||
echo not cached
|
||||
cat <<-bye | pinentry-gnome3 | sed "/^D/! d;s/^D //" | gio mount $uri
|
||||
setprompt Nextcloud password
|
||||
setdesc $account
|
||||
getpin
|
||||
bye
|
||||
;;
|
||||
esac
|
||||
ln -s gvfs/dav:host=$server,ssl=true,user=$user,prefix=%2Fremote.php%2Fwebdav /run/user/1000/nextcloud
|
Reference in New Issue
Block a user