]> de.git.xonotic.org Git - xonotic/xonotic-maps.pk3dir.git/commitdiff
add script to change lights
authorMatthias Krüger <matthias.krueger@famsik.de>
Sun, 30 Aug 2015 09:01:38 +0000 (11:01 +0200)
committerMatthias Krüger <matthias.krueger@famsik.de>
Sun, 30 Aug 2015 09:01:38 +0000 (11:01 +0200)
scripts/modify_lights.sh [new file with mode: 0755]

diff --git a/scripts/modify_lights.sh b/scripts/modify_lights.sh
new file mode 100755 (executable)
index 0000000..3482d20
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# run :  script runningman.map 
+
+FILE=$1
+FACTOR=$2
+IFS=$'\n'
+set -f
+for line in $(< $1 ); do
+       if [[ ${line} == *"light"*  ]] && [[ `echo $line | awk '{print $1}' | grep  -e "\\\\""light" | grep "\""` ]]; then
+               echo $line
+               VALUE=`echo $line | cut -d' ' -f2 | sed  's/"//g'`
+               echo $VALUE
+               echo   '"light"' \"`calc -p ${VALUE}/${FACTOR} | sed s/~//g`\" >> tmp
+       else
+               echo $line >> tmp
+       fi
+
+done < $1
+
+mv tmp $1