blob: 48be3fcb93b60df9e97b2c0a8b49f59cb58422a2 [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001#!/bin/bash
2
3process_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 Yonker1902c792014-12-03 16:48:36 -060014 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" > $dst
Dees_Troy51a0e822012-09-05 15:24:24 -040015
16 if [ $1 == $(dirname $2) ]; then
17 rm -f $src
18 fi
19}
20
21
22dest=$1
23shift 1
24for ARG in $*
25do
26 process_file $dest $ARG
27done