Yes, you will be eligible for rights entitlements if you sell shares on the ex-date, since it will be debited from your demat account on ex-date + 1, i.e. you will still be the owner of the share as on the record date. With the onset of the T+1 settlement cycle, the ex-date is the same as the record date.
To know more about Rights Issue, get the SEBI FAQs here, NSE FAQs here and BSE FAQs here.