Cleaning first-line script injection

#!/bin/bash
# By Sileep Kumar M S <sileepkumar@gmail.com>

find . -name "*.php"|while read FILE; do 
  if head -n 1 "$FILE"|grep -q "PATERN"; then
     sed -i '1 s/^.*$/<?php/g' "$FILE"
  fi
done

Popular posts from this blog

MySQL table conversion

Add addon-domain, sundomain and parked domains via shell in a Cpanel server

Cpanel Migration Script