diff options
author | David Walter Seikel | 2016-11-27 23:51:59 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-27 23:51:59 +1000 |
commit | c0ff56729a59dc30589de6af6120d825fbaa8cc3 (patch) | |
tree | 1c7e2f842548a5c9fef566d2045f3ad8aac603cb /scripts/backup-sims.sh | |
parent | White space and typo clean ups. (diff) | |
download | opensim-SC_OLD-c0ff56729a59dc30589de6af6120d825fbaa8cc3.zip opensim-SC_OLD-c0ff56729a59dc30589de6af6120d825fbaa8cc3.tar.gz opensim-SC_OLD-c0ff56729a59dc30589de6af6120d825fbaa8cc3.tar.bz2 opensim-SC_OLD-c0ff56729a59dc30589de6af6120d825fbaa8cc3.tar.xz |
Break out common script bits into their own file.
Diffstat (limited to '')
-rwxr-xr-x | scripts/backup-sims.sh | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/scripts/backup-sims.sh b/scripts/backup-sims.sh index fb18c18..2d174b1 100755 --- a/scripts/backup-sims.sh +++ b/scripts/backup-sims.sh | |||
@@ -1,25 +1,12 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | # Figure out where we are, most of this mess is to troll through soft links. | 3 | source common.sh |
4 | PRG="$0" | 4 | getPrgDir |
5 | while [ -h "${PRG}" ] ; do | ||
6 | ls=$(ls -ld "${PRG}") | ||
7 | link=`expr "${ls}" : '.*-> \(.*\)$'` | ||
8 | if expr "${link}" : '.*/.*' > /dev/null; then | ||
9 | PRG="${link}" | ||
10 | else | ||
11 | PRG=$(dirname "${PRG}")/"${link}" | ||
12 | fi | ||
13 | done | ||
14 | PRGDIR=$(dirname "${PRG}") | ||
15 | pushd ${PRGDIR} >/dev/null | ||
16 | PRGDIR=$(pwd) | ||
17 | popd >/dev/null | ||
18 | 5 | ||
19 | for i in $(seq 99) | 6 | for i in $(seq 99) |
20 | do | 7 | do |
21 | j=$(printf "sim%02d" $i) | 8 | j=$(num2name ${i}) |
22 | if [ -e "${PRGDIR}/../config/$j" ] | 9 | if [ -e "${PRGDIR}/../config/${j}" ] |
23 | then | 10 | then |
24 | cd ${PRGDIR}/../config/$j | 11 | cd ${PRGDIR}/../config/$j |
25 | ./backup-sim | 12 | ./backup-sim |