Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 1 | #!/bin/bash |
2 | |||||
3 | process_file() | ||||
4 | { | ||||
5 | dst=$1/$(basename $2) | ||||
6 | src=$2 | ||||
7 | if [ $dst == $src ]; then | ||||
8 | cp -f -p $src $src.tmp | ||||
9 | src=$2.tmp | ||||
10 | else | ||||
11 | cp -f -p $src $dst | ||||
12 | fi | ||||
13 | |||||
14 | sed "s|/system/bin/linker\x0|/sbin/linker\x0\x0\x0\x0\x0\x0\x0|g" $src | sed "s|/system/bin/sh\x0|/sbin/sh\x0\x0\x0\x0\x0\x0\x0|g" > $dst | ||||
15 | |||||
16 | if [ $1 == $(dirname $2) ]; then | ||||
17 | rm -f $src | ||||
18 | fi | ||||
19 | } | ||||
20 | |||||
21 | |||||
22 | dest=$1 | ||||
23 | shift 1 | ||||
24 | for ARG in $* | ||||
25 | do | ||||
26 | process_file $dest $ARG | ||||
27 | done |