(OK) [android-x86-6.0-rc1] /system/xbin/quagga/sbin/seem_init.sh
2016-07-16 10:03
549 查看
#!/system/bin/sh
#
#--------------------------------------------------------------------
# Note: vi /etc/preloaded-classes, #android.net.wifi.* , #android.net.EthernetManager , #android.net.Dhcp*
# recompiled android-x86-6.0-rc1
# otherwise, can't forward packages
# Note: /system/etc/init.sh will be called 4 times in /init.rc: [init, bootcomplete, hci, hci]
# seem_init.sh will be called twice in /system/etc/init.sh, that is, [init, bootcomplete]
#--------------------------------------------------------------------
# waiting a while, push init_in_android-x86_64.sh in create_vm(),
# due to that init_in_android-x86_64.sh may be exist in android-x86_64-6.0-rc1-[1-252].vdi
# if create android-x86_64-6.0-rc1-[1-252].vdi from scratch create, then can delete the following line.
#ipadd=`ifconfig eth0 |awk -F '[ :]+' 'NR==2 {print $4}'`
#echo ${ipadd}
#if [ "${ipadd}" != "112.26.2.1" ]; then
if [ ! -f /opt/init.txt ]; then
#mv /system/bin/dhcpcd /system/bin/dhcpcd.bac
#pkill dhcpcd &>/dev/null
#stop netd
#sleep 2
#log.sh 1
# Note: 112.26.2.[1-254] for android, 112.26.1.[1-254] for docker(centos)
# must to change the IP address for every Android
#ifconfig eth0 down
#ifconfig eth0 112.26.2.1 netmask 255.255.0.0 up
mount -o remount,rw /system
mount -o remount,rw /
mkdir -p /opt/android-on-linux/quagga/out/etc
cp /system/xbin/quagga/etc/zebra.conf /opt/android-on-linux/quagga/out/etc/
cp /system/xbin/quagga/etc/ospf6d.conf /opt/android-on-linux/quagga/out/etc/
sed -i '21a \ router-id 10.1.2.1' /opt/android-on-linux/quagga/out/etc/ospf6d.conf
ifconfig eth0 112.26.2.1 netmask 255.255.0.0 up
#pkill zebra &>/dev/null
#pkill ospf6d &>/dev/null
#sleep 1
/system/xbin/quagga/sbin/zebra -d
/system/xbin/quagga/sbin/ospf6d -d
touch /opt/init.txt
fi
iptables -F && iptables -F -t nat && iptables -F -t mangle
iptables -X && iptables -X -t nat && iptables -X -t mangle
ip6tables -F && ip6tables -F -t nat && ip6tables -F -t mangle
ip6tables -X && ip6tables -X -t nat && ip6tables -X -t mangle
echo 1 > /proc/sys/net/ipv4/ip_forward
#stop netd
#echo "stop netd" >> /data/ztg_tmp/timestamp.txt
#cat /proc/sys/net/ipv4/ip_forward >> /data/ztg_tmp/timestamp.txt
#date >> /data/ztg_tmp/timestamp.txt
#log.sh 1
# then, mannually execute log.sh 1 && date >> /data/ztg_tmp/logcat1.txt && logcat >> /data/ztg_tmp/logcat1.txt && start netd && date >> /data/ztg_tmp/logcat2.txt && logcat >> /data/ztg_tmp/logcat2.txt && log.sh 2
#fi
#svc wifi disable
#svc data disable
#log.sh 2
#
#--------------------------------------------------------------------
# Note: vi /etc/preloaded-classes, #android.net.wifi.* , #android.net.EthernetManager , #android.net.Dhcp*
# recompiled android-x86-6.0-rc1
# otherwise, can't forward packages
# Note: /system/etc/init.sh will be called 4 times in /init.rc: [init, bootcomplete, hci, hci]
# seem_init.sh will be called twice in /system/etc/init.sh, that is, [init, bootcomplete]
#--------------------------------------------------------------------
# waiting a while, push init_in_android-x86_64.sh in create_vm(),
# due to that init_in_android-x86_64.sh may be exist in android-x86_64-6.0-rc1-[1-252].vdi
# if create android-x86_64-6.0-rc1-[1-252].vdi from scratch create, then can delete the following line.
#ipadd=`ifconfig eth0 |awk -F '[ :]+' 'NR==2 {print $4}'`
#echo ${ipadd}
#if [ "${ipadd}" != "112.26.2.1" ]; then
if [ ! -f /opt/init.txt ]; then
#mv /system/bin/dhcpcd /system/bin/dhcpcd.bac
#pkill dhcpcd &>/dev/null
#stop netd
#sleep 2
#log.sh 1
# Note: 112.26.2.[1-254] for android, 112.26.1.[1-254] for docker(centos)
# must to change the IP address for every Android
#ifconfig eth0 down
#ifconfig eth0 112.26.2.1 netmask 255.255.0.0 up
mount -o remount,rw /system
mount -o remount,rw /
mkdir -p /opt/android-on-linux/quagga/out/etc
cp /system/xbin/quagga/etc/zebra.conf /opt/android-on-linux/quagga/out/etc/
cp /system/xbin/quagga/etc/ospf6d.conf /opt/android-on-linux/quagga/out/etc/
sed -i '21a \ router-id 10.1.2.1' /opt/android-on-linux/quagga/out/etc/ospf6d.conf
ifconfig eth0 112.26.2.1 netmask 255.255.0.0 up
#pkill zebra &>/dev/null
#pkill ospf6d &>/dev/null
#sleep 1
/system/xbin/quagga/sbin/zebra -d
/system/xbin/quagga/sbin/ospf6d -d
touch /opt/init.txt
fi
iptables -F && iptables -F -t nat && iptables -F -t mangle
iptables -X && iptables -X -t nat && iptables -X -t mangle
ip6tables -F && ip6tables -F -t nat && ip6tables -F -t mangle
ip6tables -X && ip6tables -X -t nat && ip6tables -X -t mangle
echo 1 > /proc/sys/net/ipv4/ip_forward
#stop netd
#echo "stop netd" >> /data/ztg_tmp/timestamp.txt
#cat /proc/sys/net/ipv4/ip_forward >> /data/ztg_tmp/timestamp.txt
#date >> /data/ztg_tmp/timestamp.txt
#log.sh 1
# then, mannually execute log.sh 1 && date >> /data/ztg_tmp/logcat1.txt && logcat >> /data/ztg_tmp/logcat1.txt && start netd && date >> /data/ztg_tmp/logcat2.txt && logcat >> /data/ztg_tmp/logcat2.txt && log.sh 2
#fi
#svc wifi disable
#svc data disable
#log.sh 2
相关文章推荐
- android数据保存之greendao
- Android阶段学习笔记7.15-7.17之 基础控件
- android数据保存之greendao
- android数据保存之greendao
- Android 6.0.1 Location Service 分析
- Android实现可浏览和搜索的联系人列表
- 使用AlertDialog创建单选列表对话框
- 做一个简单的Android图片缓存
- Android开发——GPS定位
- Android开发——GPS定位
- Android Studio改变应用名
- Android Studio权限管理
- 学习Android 需要什么 基础
- Android Studio 代码快捷键
- Android中surface,surfaceview,sufaceholder以及surface客户端的关系
- Android 广播大全 Intent Action 事件
- Android初级教程对大量数据的做分页处理理论知识
- Android初级教程对大量数据的做分页处理理论知识
- Android性能优化的一些理解
- Android学习笔记(一)