blob: 4e9445aeb0292f922ccdd59efe2ddb0045ef1587 [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
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
22dest=$1
23shift 1
24for ARG in $*
25do
26 process_file $dest $ARG
27done