forked from joe-speedboat/linux.scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nextcloud_drop_send.sh
executable file
·32 lines (28 loc) · 1.22 KB
/
nextcloud_drop_send.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
#########################################################################################
# DESC: script to upload multiple files into nextcoud drop folder
# tested with vRA 7.3 / CloudClient 4.4
#########################################################################################
# Copyright (c) Chris Ruettimann <[email protected]>
#
# This software is licensed to you under the GNU General Public License.
# There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
# along with this software; if not, see
# http://www.gnu.org/licenses/gpl.txt
# SETUP INSTRUCTIONS
#########################################################################################
# 1) create shared folder with no password protection
# 2) set upload only (drop folder)
# 3) copy link url
# 4) insert vars, extracted from link above
# 5) have fun
NC_URL='https://nc.domain.org'
TOKEN='aU2S6PgptNz4bNc'
test -f "$1" || (echo "Usage: $(basename $0) <file1> [file2] ..." ; exit 0)
for f in $*
do
echo "Uploading: $f"
curl -u $TOKEN: -H "X-Requested-With: XMLHttpRequest" "$NC_URL/public.php/webdav/" -T "$f"
done