• (OK) init_in_android-x86_64.sh



    #!/system/bin/sh
    # execute "sed -i '460a init_in_android-x86_64.sh' /system/etc/init.sh" in android-x86_64-6.0-rc1-0.vdi
    
    # Note: /system/xbin/quagga/sbin/init_in_android-x86_64.sh will be called 4 times in /system/etc/init.sh [init, bootcomplete, hci, hci]
    
    #--------------------------------------------------------------------
    # Note: vi /etc/preloaded-classes, #android.net.NetworkPolicyManager
    # otherwise, can't forward packages
    #--------------------------------------------------------------------
    
    # 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. 
    
    #sleep 15 
    
    #stop netd
    
    ipadd=`ifconfig eth0 |awk -F '[ :]+' 'NR==2 {print $4}'`
    #echo ${ipadd}
    
    if [ "${ipadd}" != "112.26.2.5" ]; then
    
    	#sleep 30
    
    	#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.5 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.0.5' /opt/android-on-linux/quagga/out/etc/ospf6d.conf
    
    	#pkill zebra
    	#pkill ospf6d
    	#echo 1 > /proc/sys/net/ipv4/ip_forward
    
    	#sleep 1
    	/system/xbin/quagga/sbin/zebra -d
    	/system/xbin/quagga/sbin/ospf6d -d
    fi
    
    iptables -F
    iptables -X
    
    #iptables -F -t nat
    #iptables -X -t nat
    
    #iptables -F -t mangle
    #iptables -X -t mangle
    
    #svc wifi disable
    #svc data disable
    
    #log.sh 2
    
    echo 1 > /proc/sys/net/ipv4/ip_forward
    
    


  • 相关阅读:
    POJ 3159 :Candies 【线性差分约束 链式前向星 栈优化SPFA】
    APM系统SkyWalking介绍
    ELK架构下利用Kafka Group实现Logstash的高可用
    每个人都应有自己的产品
    几行代码养只猫,心情瞬间好多了
    Redis删除特定前缀key的优雅实现
    每个人都应有自己的作品
    Nginx的几个常用配置和技巧
    Nginx与安全有关的几个配置
    开源推荐
  • 原文地址:https://www.cnblogs.com/ztguang/p/12646168.html
Copyright © 2020-2023  润新知