diff options
author | onefang | 2019-08-13 01:00:58 +1000 |
---|---|---|
committer | onefang | 2019-08-13 01:00:58 +1000 |
commit | 8c34b5efe171e9f3b6daf3cefd319872684d121f (patch) | |
tree | ad93a4632b3fa19d18700ace79a2099842869b41 | |
parent | Remove the left overs from the check4096 crap that is obsolete. (diff) | |
download | opensim-SC-8c34b5efe171e9f3b6daf3cefd319872684d121f.zip opensim-SC-8c34b5efe171e9f3b6daf3cefd319872684d121f.tar.gz opensim-SC-8c34b5efe171e9f3b6daf3cefd319872684d121f.tar.bz2 opensim-SC-8c34b5efe171e9f3b6daf3cefd319872684d121f.tar.xz |
Stop using num2name() in scripts.
Turns out I was feeding "01" to it, so that's why it thought things
where octal, and "01" is the result we wanted anyway.
-rwxr-xr-x | scripts/backup-sims.sh | 5 | ||||
-rwxr-xr-x | scripts/common.sh | 6 | ||||
-rwxr-xr-x | scripts/install/create_sim.sh | 3 |
3 files changed, 5 insertions, 9 deletions
diff --git a/scripts/backup-sims.sh b/scripts/backup-sims.sh index cadb9a2..06cb780 100755 --- a/scripts/backup-sims.sh +++ b/scripts/backup-sims.sh | |||
@@ -5,10 +5,9 @@ getPrgDir | |||
5 | 5 | ||
6 | for i in $(seq -w 1 99) | 6 | for i in $(seq -w 1 99) |
7 | do | 7 | do |
8 | j=$(num2name ${i}) | 8 | if [ -e "${PRGDIR}/../../config/sim${i}" ] |
9 | if [ -e "${PRGDIR}/../../config/${j}" ] | ||
10 | then | 9 | then |
11 | pushd ${PRGDIR}/../../config/${j} >/dev/null | 10 | pushd ${PRGDIR}/../../config/sim${i} >/dev/null |
12 | # Find out the size of the last backup, base our later sleep on that, but do it now before backup-sim packs it away. | 11 | # Find out the size of the last backup, base our later sleep on that, but do it now before backup-sim packs it away. |
13 | sizeSleep=`sleepPerSize o "$(getSimName ${i})"` | 12 | sizeSleep=`sleepPerSize o "$(getSimName ${i})"` |
14 | ./backup-sim | 13 | ./backup-sim |
diff --git a/scripts/common.sh b/scripts/common.sh index 9d985f2..6aeb8b5 100755 --- a/scripts/common.sh +++ b/scripts/common.sh | |||
@@ -28,9 +28,7 @@ getPrgDir() | |||
28 | # name=$(num2name 1) | 28 | # name=$(num2name 1) |
29 | num2name() | 29 | num2name() |
30 | { | 30 | { |
31 | # Using a string format, coz using a number format ends with an octal error, coz 08 isn't a valid octal number. | 31 | /usr/bin/printf 'sim%02d' "$1" |
32 | # Why isn't octal dead already? | ||
33 | printf 'sim%02s' "$1" | ||
34 | } | 32 | } |
35 | 33 | ||
36 | 34 | ||
@@ -46,7 +44,7 @@ sanitize() | |||
46 | # name=$(getSimName 1) | 44 | # name=$(getSimName 1) |
47 | getSimName() | 45 | getSimName() |
48 | { | 46 | { |
49 | grep "RegionName" ${PRGDIR}/../../config/$(num2name $1)/*.ini | head -n 1 | cut -d '"' -f 2 | 47 | grep "RegionName" ${PRGDIR}/../../config/sim$1/*.ini | head -n 1 | cut -d '"' -f 2 |
50 | } | 48 | } |
51 | 49 | ||
52 | 50 | ||
diff --git a/scripts/install/create_sim.sh b/scripts/install/create_sim.sh index 055f802..0aa0941 100755 --- a/scripts/install/create_sim.sh +++ b/scripts/install/create_sim.sh | |||
@@ -13,8 +13,7 @@ cd ${OS_PATH}/config | |||
13 | k=0 | 13 | k=0 |
14 | for i in $(seq -w 1 99) | 14 | for i in $(seq -w 1 99) |
15 | do | 15 | do |
16 | j=$(num2name "$i") | 16 | if [ -e "sim$j" ] |
17 | if [ -e "$j" ] | ||
18 | then | 17 | then |
19 | k=$i | 18 | k=$i |
20 | fi | 19 | fi |