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 | |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 14 | sed "s|/system/bin/linker64\x0|/sbin/linker64\x0\x0\x0\x0\x0\x0\x0|g" $src | sed "s|/system/bin/linker\x0|/sbin/linker\x0\x0\x0\x0\x0\x0\x0|g" | sed "s|/system/bin/sh\x0|/sbin/sh\x0\x0\x0\x0\x0\x0\x0|g" | sed "s|/system/lib64\x0|/sbin\x0\x0\x0\x0\x0\x0\x0\x0\x0|g" | sed "s|/system/lib\x0|/sbin\x0\x0\x0\x0\x0\x0\x0|g" > $dst |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 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 |