aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts/backup-sims.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/backup-sims.sh')
-rwxr-xr-xscripts/backup-sims.sh21
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. 3source common.sh
4PRG="$0" 4getPrgDir
5while [ -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
13done
14PRGDIR=$(dirname "${PRG}")
15pushd ${PRGDIR} >/dev/null
16PRGDIR=$(pwd)
17popd >/dev/null
18 5
19for i in $(seq 99) 6for i in $(seq 99)
20do 7do
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