5250 |
18 Jan 19 |
nicklas |
#!/bin/sh |
5250 |
18 Jan 19 |
nicklas |
2 |
# |
5250 |
18 Jan 19 |
nicklas |
# Usage: ./mkdirs.sh [LEVEL3DIR] |
5250 |
18 Jan 19 |
nicklas |
# Creates the release directory structure in the LEVEL3DIR directory. |
5250 |
18 Jan 19 |
nicklas |
# The current directory is used by default. |
5250 |
18 Jan 19 |
nicklas |
6 |
# |
5250 |
18 Jan 19 |
nicklas |
7 |
<<RELEASEINFO>> |
5250 |
18 Jan 19 |
nicklas |
8 |
|
5250 |
18 Jan 19 |
nicklas |
9 |
LEVEL3DIR=${1-.} |
5250 |
18 Jan 19 |
nicklas |
10 |
|
5250 |
18 Jan 19 |
nicklas |
11 |
NUMPATHS=<<NUMPATHS>> |
5250 |
18 Jan 19 |
nicklas |
12 |
NCREATED=0 |
5250 |
18 Jan 19 |
nicklas |
13 |
|
5250 |
18 Jan 19 |
nicklas |
14 |
echo "Creating ${NUMPATHS} paths in '${LEVEL3DIR}'" |
5250 |
18 Jan 19 |
nicklas |
15 |
|
5250 |
18 Jan 19 |
nicklas |
# Creates a path in LEVEL3DIR |
5250 |
18 Jan 19 |
nicklas |
# $1 = The path to create (for example, /S000001/l.r.m.c.lib.g) |
5250 |
18 Jan 19 |
nicklas |
18 |
function createPath { |
5250 |
18 Jan 19 |
nicklas |
19 |
NCREATED=$(( ${NCREATED} + 1 )) |
5250 |
18 Jan 19 |
nicklas |
20 |
echo "[${NCREATED}/${NUMPATHS}] ${LEVEL3DIR}${1}" |
5250 |
18 Jan 19 |
nicklas |
21 |
mkdir -p ${LEVEL3DIR}${1} |
5250 |
18 Jan 19 |
nicklas |
22 |
} |
5250 |
18 Jan 19 |
nicklas |
23 |
|
5250 |
18 Jan 19 |
nicklas |
24 |
<<SCRIPT>> |
5250 |
18 Jan 19 |
nicklas |
25 |
|
5250 |
18 Jan 19 |
nicklas |
26 |
echo Done: ${NCREATED} paths created |
5250 |
18 Jan 19 |
nicklas |
27 |
|