用到了bash的几个知识点,记录一下
2017-03-23 10:24
453 查看
#! /bin/bash
tar -xf boost.tgz -C /
tar -xf libnl.tgz -C /
tar -xf wfw.tgz -C /
export PATH=$PATH:/usr/bin/Sec/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/Sec
echo "Please input the parameters of DevId IP PeerId PeerIp PeerLan"
read -a para
str0="sed -i 's|^DevId=.*|DevId="${para[0]}"|' /etc/security/Sec/ctrlapp/Ctrlapp.ini"
eval $str0
str1="sed -i 's|IP=.*|IP="${para[1]}"|' /etc/security/Sec/ctrlapp/Ctrlapp.ini"
eval $str1
str2="sed -i 's|PeerId=.*|PeerId="${para[2]}"|' /etc/security/Sec/ctrlapp/Ctrlapp.ini"
eval $str2
str3="sed -i 's|PeerIp=.*|PeerIp="${para[3]}"|' /etc/security/Sec/ctrlapp/Ctrlapp.ini"
eval $str3
str4="sed -i 's|PeerLan=.*|PeerLan="${para[4]}"|' /etc/security/Sec/ctrlapp/Ctrlapp.ini"
eval $str4
echo "Please input the three eths which will be changed "
filterconfig set fast_mode off
read -a ethx
ethtool -K ${ethx[0]} tx off
ethtool -K ${ethx[0]} rx off
ethtool -K ${ethx[0]} tso off
ethtool -K ${ethx[0]} gso off
ethtool -K ${ethx[0]} gro off
ethtool -K ${ethx[1]} tx off
ethtool -K ${ethx[1]} rx off
ethtool -K ${ethx[1]} tso off
ethtool -K ${ethx[1]} gso off
ethtool -K ${ethx[1]} gro off
#cp ./secla.ko /lib/modules/2.6.32.60/kernel/Sec
insmod /lib/modules/2.6.32.60/kernel/Sec/secla.ko
#if [ -f "/proc/sys/seclabel/port" ]; then
# echo "${ethx[2]}" > /proc/sys/seclabel/port
#else
# cd /proc/sys
# mkdir seclabel
# mkdir -p /proc/sys/seclabel
# touch /proc/sys/seclabel/port
echo "${ethx[2]}" > /proc/sys/seclabel/port
#fi
tar -xf boost.tgz -C /
tar -xf libnl.tgz -C /
tar -xf wfw.tgz -C /
export PATH=$PATH:/usr/bin/Sec/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/Sec
echo "Please input the parameters of DevId IP PeerId PeerIp PeerLan"
read -a para
str0="sed -i 's|^DevId=.*|DevId="${para[0]}"|' /etc/security/Sec/ctrlapp/Ctrlapp.ini"
eval $str0
str1="sed -i 's|IP=.*|IP="${para[1]}"|' /etc/security/Sec/ctrlapp/Ctrlapp.ini"
eval $str1
str2="sed -i 's|PeerId=.*|PeerId="${para[2]}"|' /etc/security/Sec/ctrlapp/Ctrlapp.ini"
eval $str2
str3="sed -i 's|PeerIp=.*|PeerIp="${para[3]}"|' /etc/security/Sec/ctrlapp/Ctrlapp.ini"
eval $str3
str4="sed -i 's|PeerLan=.*|PeerLan="${para[4]}"|' /etc/security/Sec/ctrlapp/Ctrlapp.ini"
eval $str4
echo "Please input the three eths which will be changed "
filterconfig set fast_mode off
read -a ethx
ethtool -K ${ethx[0]} tx off
ethtool -K ${ethx[0]} rx off
ethtool -K ${ethx[0]} tso off
ethtool -K ${ethx[0]} gso off
ethtool -K ${ethx[0]} gro off
ethtool -K ${ethx[1]} tx off
ethtool -K ${ethx[1]} rx off
ethtool -K ${ethx[1]} tso off
ethtool -K ${ethx[1]} gso off
ethtool -K ${ethx[1]} gro off
#cp ./secla.ko /lib/modules/2.6.32.60/kernel/Sec
insmod /lib/modules/2.6.32.60/kernel/Sec/secla.ko
#if [ -f "/proc/sys/seclabel/port" ]; then
# echo "${ethx[2]}" > /proc/sys/seclabel/port
#else
# cd /proc/sys
# mkdir seclabel
# mkdir -p /proc/sys/seclabel
# touch /proc/sys/seclabel/port
echo "${ethx[2]}" > /proc/sys/seclabel/port
#fi
相关文章推荐
- 记录一下最近用到的几个知识点
- linq 这几天用到的知识点,记录一下加强印象。
- 记录一下几个网址。
- 经常用到取整的函数,今天小小的总结一下!其实很简单,就是几个函数而已~~主要是:ceil,floor,round,intval
- Idea和javaIO的几个知识点记录
- 总结一下近来记录下来的知识点
- html入门(要用到, 所以学学, 记录一下)
- 记录一下自己在学习中遇到的前端知识点
- 用到了base64转图片文件的函数,记录一下
- 自己不太熟悉几个知识点,要加强一下。
- 记录一下Hash长度扩展攻击的几个题目
- 自己做的几个小软件(数学工具和游戏),用C/C#制作,用到许多相关的C#技术细节,可以免费提供下载,感兴趣的,来看一下
- C#的几个循环语句记录一下
- C#中文件操作的小结 由于有时候用到就忘了,所以记录一下,以便下次用到
- 记录一下犯的几个低级错误
- 机器学习的几个知识点记录(转)
- 这两年项目用到的CPU/MCU,记录一下
- js里几个写法,第一次写,记录一下
- 记录几个知识点
- 最近常用的几个命令 记录一下