#!/usr/bin/perl
# Copyright 2006 Ensim Corporation
# Author - atul
@services = ('isp','site','reseller','siteuser') ;
foreach $service (@services){
	$FILE = "/usr/lib/ensim/frontend/kidpages/$service/services/vhbackup/editScheduleBackup.kid" ;
	print "Applying fix ....\n" ;
	system("/bin/cp $FILE $FILE- ");
	open(FILE,$FILE) ;
	@lines = <FILE> ;
	close(FILE) ;
	
	open(FILE,">$FILE") ;
	foreach (@lines){
		if($_ =~ /ftp_password/ ){
			$_ =~s/ftp_username/ftp_password/g ;
			print FILE $_ ;
		}else{
			print FILE $_ ;
		}
	}
	close(FILE);
	system("/bin/rm -f /usr/lib/ensim/frontend/kidpages/$service/services/vhbackup/editScheduleBackup.pyc") ;
}
system("/sbin/service epld restart") ;
print "\n";
print "Fix applied successfully!\n" ;
print "\n";

