开机sh
来源:互联网 发布:剑三正太脸型数据网盘 编辑:程序博客网 时间:2024/06/06 00:36
1. init.rc 里添加服务
service ips /system/bin/ips.sh
user root
group root
disabled
oneshot
on property:sys.boot_completed=1
start ips
或者
service iptable /system/bin/ips.sh
class main
user root
group root
oneshot
2.写shell脚本,比如
#!/system/bin/sh
#!/system/bin/sh
ipts -w -I INPUT -m limit --limit 50/s -j ACCEPT
ipas -w -I INPUT -j DROP
ipbles -w -I OUTPUT -m limit --limit 50/s -j ACCEPT
tables -w -I OUTPUT -j DROP
3.添加selinux权限
3.1 新建te
type ips, domain;
type ips_exec, exec_type, file_type;
init_daemon_domain(ips)
allow ips proc:file { open read setattr getattr ioctl write};
allow ips ips:rawip_socket { create getopt setopt };
allow ips shell_exec:file { execute read open execute_no_trans getattr };
allow ips system_file:file execute_no_trans;
allow ips ips:capability { net_raw net_admin };
allow ips proc_net:file { read open getattr };
3.2
filecontext添加
/system/bin/ips.sh u:object_r:ips_exec:s0
- 开机sh
- linux 如何开机自动运行sh脚本
- Linux下开机启动sh文件
- linux 开机自动运行sh脚本
- mac下开机root启动.sh文件
- 树莓派开机 延时运行sh脚本
- Linux如何在开机时自动执行sh文件
- centos开机自动运行[.sh]程序的方法
- java服务器开机启动Shell命令server_boot.sh
- 飞凌嵌入式OK335xD Linux下Qt程序开机启动 及 sh开机启动
- 飞凌嵌入式OK335xD Linux下Qt程序开机启动 及 sh开机启动
- sh
- weblogstop.sh
- man sh
- stopMS01.sh
- stopAdmin.sh
- RunWebserver.sh
- 20070910sh
- 最简单的web单点登录(SSO)
- oracle与mysql group by区别
- RxJava 2.x入门教程
- LintCode 46.主元素
- heartbeat+drbd实现磁盘共享自动挂载切换
- 开机sh
- 解决Unity3D打包Xcode项目IOS运行莫名其妙闪退崩溃
- HTML5(一)
- hdu 6200 mustedge mustedge mustedge
- 用fprintf()函数输出复数的虚部
- Leetcode 532. K-diff Pairs in an Array
- (CodeForces
- Ubuntu 搭建Jenkins服务器以及配置邮件工程全解
- 51Nod