I am using LineageOS 18.1
When I was on LOS 16, I used to edit the file
/system/etc/init.d/00banner and put my iptables commands there, e.g.:
sh -c 'iptables -A OUTPUT -m owner --uid-owner 10195 -d 126.96.36.199/23 -j REJECT'
All iptables commands I put in there used to run on phone start up. But in LOS 18.1, the
/system/etc/init.d/ directory was deprecated.
1. I created and filled the custom script with the iptables commands above:
chmod 0755 /system/etc/custominit.sh
2. Then I edited
/system/etc/init/hw/init.rc and I added to the end:
chmod 0755 /system/etc/custominit
3. I also tried adding:
service custominit /system/bin/custominit.sh
But none of this worked.
What is it that I doing wrong? I have root access but I do not want to install any additional apps on my phone for this, as it was possible to do on LOS 16.