-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathmake-tds
executable file
·28 lines (25 loc) · 1.23 KB
/
make-tds
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
#!/usr/bin/env bash
# This script is a simple wrapper for mawaya's fclone backed command `add-drive`
# Grab the executable from https://github.com/mawaya/rclone/releases and put in /usr/bin/
# For a couple TDs you can simply use the fclone command manually
#
# `gdrive` is a mydrive or td that has full administrative permissions - used for authentication
# `members` is an existing TD whose members/groups you want to mirror in the new TDs
# `declare -a prefix`` is a common prefix or prefixes for the TDs you want to create [optional]
# `declare -a td` are the non common suffices for the new drives. Keep parentheses and use double quotes
#
# Note: gdrive and members include colon: while prefix and td list do not
# The default entries below would create 10 TDs with the same members/perms as my-td.
# That is, TDs named `goober-001` .. `goober-005` and `gawber-001` .. `gawber-005`
gdrive="mydrive:"
members="my-td:"
declare -a prefix=("goober" "gawber")
declare -a td=("-001" "-002" "-003" "-004" "-005")
for j in "${prefix[@]}"; do
for i in "${td[@]}"; do
echo "Creating new TD named $j$i"
fclone backend add-drive $gdrive $j$i --tpslimit=1 -o copy-members=$members
sleep 10s
done
done
fclone backend lsdrives $gdrive | grep "$prefix"