bigbiff | 6087339 | 2020-03-23 15:41:27 -0400 | [diff] [blame] | 1 | #!/bin/bash |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 2 | |
| 3 | process_file() |
| 4 | { |
| 5 | dst=$1/$(basename $2) |
| 6 | src=$2 |
bigbiff | 6087339 | 2020-03-23 15:41:27 -0400 | [diff] [blame] | 7 | |
| 8 | if [ ! -e $src ]; then |
| 9 | return |
| 10 | fi |
| 11 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 12 | if [ $dst == $src ]; then |
| 13 | cp -f -p $src $src.tmp |
| 14 | src=$2.tmp |
| 15 | else |
bigbiff | d58ba18 | 2020-03-23 10:02:29 -0400 | [diff] [blame] | 16 | cp -f -p --remove-destination $src $dst |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 17 | fi |
| 18 | |
bigbiff | d58ba18 | 2020-03-23 10:02:29 -0400 | [diff] [blame] | 19 | 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 |
bigbiff | 973167a | 2020-04-06 15:44:20 -0400 | [diff] [blame] | 20 | #rm -f $src |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | |
| 24 | dest=$1 |
| 25 | shift 1 |
| 26 | for ARG in $* |
| 27 | do |
| 28 | process_file $dest $ARG |
| 29 | done |