-
scintist 说:
@ChatGPT “新发展格局以现代化产业体系为基础,经济循环畅通需要各产业有序链接、高效畅通。要继续把发展经济的着力点放在实体经济上,扎实推进新型工业化,加快建设制造强国、质量强国、网络强国、数字中国,打造具有国际竞争力的数字产业集群”这段话在通信行业领域有哪些工作要求,下一步工作措施有哪些
这段话强调了新发展格局需要实现经济循环畅通,打造具有国际竞争力的数字产业集群,并特别提到了要推进网络强国和数字中国建设。下面是针对通信行业领域的工作要求和下一步工作措施:
-
稳步推进5G建设:5G是数字经济时代的基础设施,是一个强大的综合平台,通信行业需要加强5G网络建设、频谱规划、商用应用等方面的投入。
-
推进宽带网络建设:要深入推进“宽带中国”建设,持续加强宽带网络基础建设和提升网络速度,以提高数据传输的效率和准确性。
-
大力发展物联网:将传统通信行业与物联网技术结合起来,发展智能家居、智慧城市等方面的应用,提高生产效率和人民生活质量。
-
提高可靠性、稳定性、安全性:在网络运行过程中,需要考虑通信网络的可靠性、稳定性和安全性等因素,为广大用户提供高品质的通信服务。
-
发展数字化产业:加快通信行业向数字化、网络化、智能化转型,推动数字化产业的发展,完善产业链及商业模式,打造数字产业集群。
为实现这些工作要求,下一步通信行业可能采取以下措施:
-
加大技术研发和投入力度,完善网络设施及技术规范。
-
推动技术创新和实用应用的结合,推广5G、物联网等领先技术。
-
完善通信服务质量监管体系,严格监管通信企业的管理和运营。
-
加强与其他产业的联动合作,全面推进数字化产业的发展。
-
加强国际合作,与其他国家或地区分享技术和资源,推动行业全球化发展。
-
-
dianka2 说:
@ChatGPT 焊机焊接最后多厚的铁板,有什么要求?
焊机焊接铁板的厚度取决于所使用的焊机类型和规格,以及焊接工艺的操作技能。一般来说,手摇电焊机适合焊接较薄的铁板,一般不超过5毫米,而气体保护焊或电弧焊等高级焊接方法可以焊接更厚的铁板,甚至可以达到数十毫米的厚度。
在选择焊接铁板时,需要考虑以下一些要求:
1.焊材的选取: 应选择与被焊件材料相同的焊材, 或相似的焊材.
2.焊接条件: 需要掌握好电流、电压、电极大小、每厘米开弧次数的控制及其他焊接条件.
3.表面准备:焊前应做好被焊件表面的清洁和处理,以避免焊缝质量不佳。
4.操作技能:需要熟练的焊接技能及经验,能够准确地掌握焊接温度,焊接速度等参数。
总的来说,除了考虑材料厚度,选择合适的焊接方法、焊材和技术方案,以及准确掌握焊接参数和技能是焊接铁板要求的关键。
-
scintist 说:
@ChatGPT 如何理解“要完整、准确、全面贯彻新发展理念,加快构建新发展格局,着力推动高质量发展”
“要完整、准确、全面贯彻新发展理念,加快构建新发展格局,着力推动高质量发展”,是指在当前中国社会经济发展的背景下,需要坚持新发展理念,以加快构建新的发展格局,着力推动高质量的经济发展。
其中,“完整、准确、全面贯彻新发展理念”意味着在各个方面和各个阶段都要贯彻新发展理念,这可以使经济和社会发展更加科学和可持续。
“加快构建新发展格局”则是指在众多的制度和政策保障的基础上,深化各种改革,努力推动经济的新发展形态和新产业的发展,为全国经济持续快速发展提供保障。
最后,“着力推动高质量发展”是指通过有效的科学系统和可行的手段,在不断提升经济发展效益和质量的同时,还必须加快创新,提高科技水平和创新能力,增强核心竞争力,使中国的经济发展能够更快更好地增长,更加优势地面向未来,更加符合人民群众的根本利益和期待。
-
@ChatGPT #!/bin/bash
argv=$1
#deploy=$1
count=0
filename=()
isTar=1
if [ $isTar == "1" ]
thenpath=
cd $(dirname $0);pwd -P
#echo the current path is:$path
for i inls
do
filegz="tar.gz"
if [[ $i == $filegz ]]
then
#echo $i
filename[count]=$i
count=expr $count + 1
fi
done#echo $count
#echo ${filename[@]}
for((n=0;n<${#filename[@]};n++)){
echo -e "\033[40;35m"$n"\033[0m \033[40;32m"${filename[n]}"\033[0m"
}if (("$count" <= "0"));
then
echo "请下载部署包"
exit
elif (("$count" == "1"));
then
if [ $argv == "PBox" ];
then
tar zxvf ${filename[0]} -C /pbox
else
tar zxvf ${filename[0]} -C /mnt
fi
else
echo -e "\033[40;36m 请选择部署包:\033[0m"
read inNum
if (("$inNum" < "0")) || (("$inNum" >= "$count"))
then
echo "索引错误"
exit
else
if [ $argv == "PBox" ];
then
tar zxvf ${filename[0]} -C /pbox
else
tar zxvf ${filename[0]} -C /mnt
fi
fi
fi
fi#echo "解压部署包"
#echo $deploy
#tar -zxvf $deploy
#echo "解压部署包完成"inspect(){
if [ $argv != "PBox16.04" ];
then
cp -rf /mnt/profile /etc/
fi
if [ ! -d "/mnt/FCloudComm" ]
then
echo "1"
exit
fi
if [ ! -f "/mnt/run.sh" ]
then
echo "2"
exit
fiif [ ! -f "/usr/lib/libiconv.so.2.6.1" ]; then cp -rf /mnt/FCloudComm/bin/libiconv.so.2.6.1 /usr/lib/ ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so.2 fi sed -i '/source/d' /etc/init.d/rc.local sed -i '$a source /mnt/run.sh' /etc/init.d/rc.local #taosd &>/dev/null echo "历史数据库安装完成"
}
inspectPBox(){
if [ ! -d "/pbox/FCloudComm" ]
then
echo "1"
exit
fi
if [ ! -f "/pbox/run.sh" ]
then
echo "2"
exit
fiif [ ! -f "/usr/lib/libiconv.so.2.6.1" ]; then cp -rf /pbox/FCloudComm/bin/libiconv.so.2.6.1 /usr/lib/ ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so.2 fi #taosd &>/dev/null echo "历史数据库安装完成"
}
echo "拷贝系统文件"
if [ $argv == "8401d" ];
then
cp -rf ./libstdc++.so.6 /usr/lib/arm-linux-gnueabihf/
cp -rf ./libstdc++.so.6.0.21 /usr/lib/arm-linux-gnueabihf/
fiif [ $argv == "ISG" ];
then
cp -rf ./libstdc++.so.6.0.21 /usr/lib/arm-linux-gnueabihf/
ln -sf /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.21 /usr/lib/arm-linux-gnueabihf/libstdc++.so.6if [ ! -f "/usr/lib/libatomic.so.1.0.0" ];
then
cp -rf /mnt/FCloudComm/bin/libatomic.so.1.0.0 /usr/lib/
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so.1
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so
fi
fiecho "拷贝系统文件完成"
echo -e "\033[40;36m 网口选择 单网(1)双网(2) \033[0m"
read input
#echo $input
if [ $input == "1" ];
then
sed -i 's/NetCardCount = "2"/NetCardCount = "1"/g' /mnt/FCloudComm/bin/pSL_Setting.xml
sed -i '/sleep 1/d' /mnt/FCloudComm/tools/IPCfg
sed -i '/ifconfig eth1 192.168.20.101 netmask 255.255.255.0 up/d' /mnt/FCloudComm/tools/IPCfg
sed -i '/route add default gw 192.168.20.1 dev eth1/d' /mnt/FCloudComm/tools/IPCfg
fi
echo "网口配置完成"#4G函数
echo -e "\033[40;36m 是否支持4G? 否(0)是(1) \033[0m"read -p "" number
if [ $number -eq 0 ];
then
if [ $argv == "8401d" ];
then
sed -i '/active4g.sh/d' /mnt/run.sh
fiif [ $argv == "PBox" ]; then sed -i '/quectel-pppd.sh/d' /pbox/run.sh fi if [ $argv == "PBox16.04" ]; then sed -i '/quectel-pppd.sh/d' /mnt/run.sh fi
fi
if [ $number -eq 1 ];
then
if [ $argv == "8401d" ];
then
sed -i '/active4g.sh/d' /mnt/run.sh
sed -i '/sleep 10/i\sh ./active4g.sh &' /mnt/run.sh
fiif [ $argv == "PBox" ]; then sed -i '/quectel-pppd.sh/d' /pbox/run.sh sed -i '/sleep 10/i\sh ./quectel-pppd.sh &' /pbox/run.sh fi if [ $argv == "PBox16.04" ]; then sed -i '/quectel-pppd.sh/d' /mnt/run.sh sed -i '/sleep 10/i\sh ./quectel-pppd.sh &' /mnt/run.sh fi
fi
if [ $number -ne 1 ] && [ $number -ne 0 ];
then
echo "输入错误"
fiecho "配置开机启动"
if [ $argv == "8401d" ];
then
sed -i '1c #! /bin/bash' /etc/init.d/rc.local
fiif [ $argv == "PBox16.04" ];
then
sed -i '1c #! /bin/bash' /etc/rc.local
fiif [ $argv == "ISG" ];
then
sed -i '1c #! /bin/bash' /etc/init.d/rocktech.sh
sed -i '/source/d' /etc/init.d/rocktech.sh
sed -i '$a source /mnt/run.sh' /etc/init.d/rocktech.sh
sed -i '/source/d' /etc/init.d/rc.local
sed -i "114s:#::g" /etc/init.d/rocktech.sh
fiecho "配置开机启动完成"
echo "初始化本地ip地址"
sed -i 's/address 190.5.20.171/address 192.168.10.101/g' /etc/network/interfaces
sed -i 's/gateway 190.5.200.11/gateway 192.168.10.1/g' /etc/network/interfaces
sed -i 's/address 192.168.1.100/address 192.168.20.101/g' /etc/network/interfaces
sed -i 's/gateway 192.168.1.1/gateway 192.168.20.1/g' /etc/network/interfaces
echo "初始化本地ip地址结束"echo "配置历史数据库"
#td库ISG网关配置
td(){
cd /mnt/TDengine-server-2.0.10.0/
./install.sh &>/dev/null
sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg
sed -i 's/# fqdn/fqdn/g' /etc/taos/taos.cfg
sed -i 's/hostname/localhost/g' /etc/taos/taos.cfg
}#PBox网关配置
PB(){
if [ ! -f "/usr/lib/libatomic.so.1.0.0" ];
then
cp -rf /pbox/FCloudComm/bin/libatomic.so.1.0.0 /usr/lib/
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so.1
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so
fised -i '1c #! /bin/bash' /etc/init.d/rc.local cd /pbox/TDengine-server-2.0.10.0 ./install.sh &>/dev/null sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg sed -i 's/# logDir/ logDir/g' /etc/taos/taos.cfg sed -i 's/# dataDir/ dataDir/g' /etc/taos/taos.cfg sed -i 's#/var/log/taos#/pbox/log#g' /etc/taos/taos.cfg sed -i 's#/var/lib/taos#/pbox/lib#g' /etc/taos/taos.cfg sed -i '/run.sh/d' /etc/rc5.d/S99rmnologin.sh sed -i '$a source /pbox/run.sh' /etc/rc5.d/S99rmnologin.sh
}
power(){
source /mnt/FCloudComm/tools/setEnv.sh
if [ -d "/mnt/config" ];then
#echo "文件夹存在"if [ -f "/mnt/config/hardwareinfo.HID" ];then #echo "文件存在" cp -rf /mnt/config/hardwareinfo.HID /mnt/FCloudComm else #echo "文件不存在" echo "配置完成 请放入HID 和 授权文件" /mnt/FCloudComm/bin/getID fi if [ -f "/mnt/config/"*".lic" ];then #echo "文件存在" cp -rf /mnt/config/*.lic /mnt/FCloudComm/bin else #echo "文件不存在" echo "配置完成 请放入HID 和 授权文件" /mnt/FCloudComm/bin/getID fi else #echo "文件夹不存在" echo "配置完成 请放入HID 和 授权文件" /mnt/FCloudComm/bin/getID fi #echo "配置完成 请放入HID 和 授权文件" #/mnt/FCloudComm/bin/getID
}
powerPBox(){
source /pbox/FCloudComm/tools/setEnv.sh
if [ -d "/pbox/config" ];then
#echo "文件夹存在"if [ -f "/pbox/config/hardwareinfo.HID" ];then #echo "文件存在" cp -rf /pbox/config/hardwareinfo.HID /pbox/FCloudComm else #echo "文件不存在" echo "配置完成 请放入HID 和 授权文件" /pbox/FCloudComm/bin/getID fi if [ -f "/pbox/config/"*".lic" ];then #echo "文件存在" cp -rf /pbox/config/*.lic /pbox/FCloudComm/bin else #echo "文件不存在" echo "配置完成 请放入HID 和 授权文件" /pbox/FCloudComm/bin/getID fi else #echo "文件夹不存在" echo "配置完成 请放入HID 和 授权文件" /pbox/FCloudComm/bin/getID fi #echo "配置完成 请放入HID 和 授权文件" #/pbox/FCloudComm/bin/getID
}
case "$1" in
8401d)
cd /mnt/TDengine-server-2.0.10.0
./install.sh &>/dev/null
sed -i 's#/third/log#log#g' /etc/taos/taos.cfg
sed -i 's#/third/data#data#g' /etc/taos/taos.cfg
sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg
inspect
power
;;
8316)
i="0"
while read path
do
if [ "$path" == "127.0.0.1 GEA-8316-DLK" ];
then
i="1"
fi
done < /etc/hostsif [ "$i" != "1" ]; then sed -i '$a\127.0.0.1 GEA-8316-DLK' /etc/hosts fi cd /mnt/TDengine-server-2.0.10.0 ./install.sh &>/dev/null sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg inspect power ;; ISG) i="0" while read path do if [ "$path" == "127.0.0.1 localhost" ]; then i="1" fi done < /etc/hosts if [ "$i" != "1" ]; then echo "127.0.0.1 localhost"> /etc/hosts fi td inspect power ;; PBox) i="0" while read path do if [ "$path" == "127.0.0.1 imx6ull14x14evk" ]; then i="1" fi done < /etc/hosts if [ "$i" != "1" ]; then echo "127.0.0.1 imx6ull14x14evk"> /etc/hosts fi PB inspectPBox powerPBox ;; PBox16.04) pkexec chown root:root /etc/sudoers /etc/sudoers.d -R td inspect power sed -i '/source/d' /etc/init.d/rc.local sed -i '/source/d' /etc/rc.local sed -i '/sleep 1/isource /mnt/run.sh' /etc/rc.local ;;
esac
用python重写
-
for culture 说:
@ChatGPT #!/bin/bash
argv=$1
#deploy=$1
count=0
filename=()
isTar=1
if [ $isTar == "1" ]
thenpath=
cd $(dirname $0);pwd -P
#echo the current path is:$path
for i inls
do
filegz="tar.gz"
if [[ $i == $filegz ]]
then
#echo $i
filename[count]=$i
count=expr $count + 1
fi
done#echo $count
#echo ${filename[@]}
for((n=0;n echo -e "\033[40;35m"$n"\033[0m \033[40;32m"${filename[n]}"\033[0m"
}if (("$count" then
echo "请下载部署包"
exit
elif (("$count" == "1"));
then
if [ $argv == "PBox" ];
then
tar zxvf ${filename[0]} -C /pbox
else
tar zxvf ${filename[0]} -C /mnt
fi
else
echo -e "\033[40;36m 请选择部署包:\033[0m"
read inNum
if (("$inNum" = "$count"))
then
echo "索引错误"
exit
else
if [ $argv == "PBox" ];
then
tar zxvf ${filename[0]} -C /pbox
else
tar zxvf ${filename[0]} -C /mnt
fi
fi
fi
fi#echo "解压部署包"
#echo $deploy
#tar -zxvf $deploy
#echo "解压部署包完成"inspect(){
if [ $argv != "PBox16.04" ];
then
cp -rf /mnt/profile /etc/
fi
if [ ! -d "/mnt/FCloudComm" ]
then
echo "1"
exit
fi
if [ ! -f "/mnt/run.sh" ]
then
echo "2"
exit
fiif [ ! -f "/usr/lib/libiconv.so.2.6.1" ];
then
cp -rf /mnt/FCloudComm/bin/libiconv.so.2.6.1 /usr/lib/
ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so
ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so.2
fised -i '/source/d' /etc/init.d/rc.local
sed -i '$a source /mnt/run.sh' /etc/init.d/rc.local#taosd &>/dev/null
echo "历史数据库安装完成"}
inspectPBox(){
if [ ! -d "/pbox/FCloudComm" ]
then
echo "1"
exit
fi
if [ ! -f "/pbox/run.sh" ]
then
echo "2"
exit
fiif [ ! -f "/usr/lib/libiconv.so.2.6.1" ];
then
cp -rf /pbox/FCloudComm/bin/libiconv.so.2.6.1 /usr/lib/
ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so
ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so.2
fi#taosd &>/dev/null
echo "历史数据库安装完成"}
echo "拷贝系统文件"
if [ $argv == "8401d" ];
then
cp -rf ./libstdc++.so.6 /usr/lib/arm-linux-gnueabihf/
cp -rf ./libstdc++.so.6.0.21 /usr/lib/arm-linux-gnueabihf/
fiif [ $argv == "ISG" ];
then
cp -rf ./libstdc++.so.6.0.21 /usr/lib/arm-linux-gnueabihf/
ln -sf /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.21 /usr/lib/arm-linux-gnueabihf/libstdc++.so.6if [ ! -f "/usr/lib/libatomic.so.1.0.0" ];
then
cp -rf /mnt/FCloudComm/bin/libatomic.so.1.0.0 /usr/lib/
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so.1
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so
fi
fiecho "拷贝系统文件完成"
echo -e "\033[40;36m 网口选择 单网(1)双网(2) \033[0m"
read input
#echo $input
if [ $input == "1" ];
then
sed -i 's/NetCardCount = "2"/NetCardCount = "1"/g' /mnt/FCloudComm/bin/pSL_Setting.xml
sed -i '/sleep 1/d' /mnt/FCloudComm/tools/IPCfg
sed -i '/ifconfig eth1 192.168.20.101 netmask 255.255.255.0 up/d' /mnt/FCloudComm/tools/IPCfg
sed -i '/route add default gw 192.168.20.1 dev eth1/d' /mnt/FCloudComm/tools/IPCfg
fi
echo "网口配置完成"#4G函数
echo -e "\033[40;36m 是否支持4G? 否(0)是(1) \033[0m"read -p "" number
if [ $number -eq 0 ];
then
if [ $argv == "8401d" ];
then
sed -i '/active4g.sh/d' /mnt/run.sh
fiif [ $argv == "PBox" ];
then
sed -i '/quectel-pppd.sh/d' /pbox/run.sh
fiif [ $argv == "PBox16.04" ];
then
sed -i '/quectel-pppd.sh/d' /mnt/run.sh
fi
fiif [ $number -eq 1 ];
then
if [ $argv == "8401d" ];
then
sed -i '/active4g.sh/d' /mnt/run.sh
sed -i '/sleep 10/i\sh ./active4g.sh &' /mnt/run.sh
fiif [ $argv == "PBox" ];
then
sed -i '/quectel-pppd.sh/d' /pbox/run.sh
sed -i '/sleep 10/i\sh ./quectel-pppd.sh &' /pbox/run.sh
fiif [ $argv == "PBox16.04" ];
then
sed -i '/quectel-pppd.sh/d' /mnt/run.sh
sed -i '/sleep 10/i\sh ./quectel-pppd.sh &' /mnt/run.sh
fi
fiif [ $number -ne 1 ] && [ $number -ne 0 ];
then
echo "输入错误"
fiecho "配置开机启动"
if [ $argv == "8401d" ];
then
sed -i '1c #! /bin/bash' /etc/init.d/rc.local
fiif [ $argv == "PBox16.04" ];
then
sed -i '1c #! /bin/bash' /etc/rc.local
fiif [ $argv == "ISG" ];
then
sed -i '1c #! /bin/bash' /etc/init.d/rocktech.sh
sed -i '/source/d' /etc/init.d/rocktech.sh
sed -i '$a source /mnt/run.sh' /etc/init.d/rocktech.sh
sed -i '/source/d' /etc/init.d/rc.local
sed -i "114s:#::g" /etc/init.d/rocktech.sh
fiecho "配置开机启动完成"
echo "初始化本地ip地址"
sed -i 's/address 190.5.20.171/address 192.168.10.101/g' /etc/network/interfaces
sed -i 's/gateway 190.5.200.11/gateway 192.168.10.1/g' /etc/network/interfaces
sed -i 's/address 192.168.1.100/address 192.168.20.101/g' /etc/network/interfaces
sed -i 's/gateway 192.168.1.1/gateway 192.168.20.1/g' /etc/network/interfaces
echo "初始化本地ip地址结束"echo "配置历史数据库"
#td库ISG网关配置
td(){
cd /mnt/TDengine-server-2.0.10.0/
./install.sh &>/dev/null
sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg
sed -i 's/# fqdn/fqdn/g' /etc/taos/taos.cfg
sed -i 's/hostname/localhost/g' /etc/taos/taos.cfg
}#PBox网关配置
PB(){
if [ ! -f "/usr/lib/libatomic.so.1.0.0" ];
then
cp -rf /pbox/FCloudComm/bin/libatomic.so.1.0.0 /usr/lib/
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so.1
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so
fised -i '1c #! /bin/bash' /etc/init.d/rc.local
cd /pbox/TDengine-server-2.0.10.0
./install.sh &>/dev/null
sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg
sed -i 's/# logDir/ logDir/g' /etc/taos/taos.cfg
sed -i 's/# dataDir/ dataDir/g' /etc/taos/taos.cfg
sed -i 's#/var/log/taos#/pbox/log#g' /etc/taos/taos.cfg
sed -i 's#/var/lib/taos#/pbox/lib#g' /etc/taos/taos.cfgsed -i '/run.sh/d' /etc/rc5.d/S99rmnologin.sh
sed -i '$a source /pbox/run.sh' /etc/rc5.d/S99rmnologin.sh
}power(){
source /mnt/FCloudComm/tools/setEnv.sh
if [ -d "/mnt/config" ];then
#echo "文件夹存在"if [ -f "/mnt/config/hardwareinfo.HID" ];then
#echo "文件存在"
cp -rf /mnt/config/hardwareinfo.HID /mnt/FCloudComm
else
#echo "文件不存在"
echo "配置完成 请放入HID 和 授权文件"
/mnt/FCloudComm/bin/getID
fiif [ -f "/mnt/config/"".lic" ];then
#echo "文件存在"
cp -rf /mnt/config/.lic /mnt/FCloudComm/bin
else
#echo "文件不存在"
echo "配置完成 请放入HID 和 授权文件"
/mnt/FCloudComm/bin/getID
fielse
#echo "文件夹不存在"
echo "配置完成 请放入HID 和 授权文件"
/mnt/FCloudComm/bin/getID
fi
#echo "配置完成 请放入HID 和 授权文件"
#/mnt/FCloudComm/bin/getID
}powerPBox(){
source /pbox/FCloudComm/tools/setEnv.sh
if [ -d "/pbox/config" ];then
#echo "文件夹存在"if [ -f "/pbox/config/hardwareinfo.HID" ];then
#echo "文件存在"
cp -rf /pbox/config/hardwareinfo.HID /pbox/FCloudComm
else
#echo "文件不存在"
echo "配置完成 请放入HID 和 授权文件"
/pbox/FCloudComm/bin/getID
fiif [ -f "/pbox/config/"".lic" ];then
#echo "文件存在"
cp -rf /pbox/config/.lic /pbox/FCloudComm/bin
else
#echo "文件不存在"
echo "配置完成 请放入HID 和 授权文件"
/pbox/FCloudComm/bin/getID
fielse
#echo "文件夹不存在"
echo "配置完成 请放入HID 和 授权文件"
/pbox/FCloudComm/bin/getID
fi
#echo "配置完成 请放入HID 和 授权文件"
#/pbox/FCloudComm/bin/getID
}case "$1" in
8401d)
cd /mnt/TDengine-server-2.0.10.0
./install.sh &>/dev/null
sed -i 's#/third/log#log#g' /etc/taos/taos.cfg
sed -i 's#/third/data#data#g' /etc/taos/taos.cfg
sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg
inspect
power
;;
8316)
i="0"
while read path
do
if [ "$path" == "127.0.0.1 GEA-8316-DLK" ];
then
i="1"
fi
done
if [ "$i" != "1" ];
then
sed -i '$a\127.0.0.1 GEA-8316-DLK' /etc/hosts
ficd /mnt/TDengine-server-2.0.10.0 ./install.sh &>/dev/null sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg inspect power ;;
ISG)
i="0"
while read path
do
if [ "$path" == "127.0.0.1 localhost" ];
then
i="1"
fi
done
if [ "$i" != "1" ];
then
echo "127.0.0.1 localhost"> /etc/hosts
fitd inspect power ;;
PBox)
i="0"
while read path
do
if [ "$path" == "127.0.0.1 imx6ull14x14evk" ];
then
i="1"
fi
done
if [ "$i" != "1" ];
then
echo "127.0.0.1 imx6ull14x14evk"> /etc/hosts
fi
PB
inspectPBox
powerPBox
;;
PBox16.04)
pkexec chown root:root /etc/sudoers /etc/sudoers.d -R
td
inspect
power
sed -i '/source/d' /etc/init.d/rc.local
sed -i '/source/d' /etc/rc.local
sed -i '/sleep 1/isource /mnt/run.sh' /etc/rc.local
;;
esac用python重写
把原先的bash脚本用Python来实现,具体如下:
#!/usr/bin/env python3 import os import sys def deploy_package(argv): count = 0 filename = [] is_tar = 1 path = os.path.abspath(os.path.dirname(__file__)) for file in os.listdir(path): if is_tar and file.endswith(".tar.gz"): filename.append(file) count += 1 if count = count: print("索引错误") sys.exit() else: tar_path = "/pbox" if argv == "PBox" else "/mnt" os.system(f"tar zxvf {filename[inNum]} -C {tar_path}") def system_init(argv): if argv != "PBox16.04": os.system("cp -rf /mnt/profile /etc/") if not os.path.isdir("/mnt/FCloudComm"): print("1") sys.exit() if not os.path.isfile("/mnt/run.sh"): print("2") sys.exit() if not os.path.isfile("/usr/lib/libiconv.so.2.6.1"): os.system("cp -rf /mnt/FCloudComm/bin/libiconv.so.2.6.1 /usr/lib/") os.system("ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so") os.system("ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so.2") with open("/etc/init.d/rc.local", "r+") as f: lines = f.readlines() f.seek(0) for l in lines: if "source" not in l: f.write(l) f.write("source /mnt/run.sh\n") print("历史数据库安装完成") def system_init_pbox(): if not os.path.isdir("/pbox/FCloudComm"): print("1") sys.exit() if not os.path.isfile("/pbox/run.sh"): print("2") sys.exit() if not os.path.isfile("/usr/lib/libatomic.so.1.0.
-
@ChatGPT #!/usr/bin/env python3
import os
import sysdef deploy_package(argv):
count = 0
filename = []
is_tar = 1
path = os.path.abspath(os.path.dirname(file))for file in os.listdir(path): if is_tar and file.endswith(".tar.gz"): filename.append(file) count += 1 if count = count: print("索引错误") sys.exit() else: tar_path = "/pbox" if argv == "PBox" else "/mnt" os.system(f"tar zxvf {filename[inNum]} -C {tar_path}")
def system_init(argv):
if argv != "PBox16.04":
os.system("cp -rf /mnt/profile /etc/")
if not os.path.isdir("/mnt/FCloudComm"):
print("1")
sys.exit()
if not os.path.isfile("/mnt/run.sh"):
print("2")
sys.exit()if not os.path.isfile("/usr/lib/libiconv.so.2.6.1"): os.system("cp -rf /mnt/FCloudComm/bin/libiconv.so.2.6.1 /usr/lib/") os.system("ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so") os.system("ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so.2") with open("/etc/init.d/rc.local", "r+") as f: lines = f.readlines() f.seek(0) for l in lines: if "source" not in l: f.write(l) f.write("source /mnt/run.sh\n") print("历史数据库安装完成")
def system_init_pbox():
if not os.path.isdir("/pbox/FCloudComm"):
print("1")
sys.exit()
if not os.path.isfile("/pbox/run.sh"):
print("2")
sys.exit()if not os.path.isfile("/usr/lib/libatomic.so.1.0.
解释一下这段代码
-
for culture 说:
@ChatGPT #!/usr/bin/env python3
import os
import sysdef deploy_package(argv):
count = 0
filename = []
is_tar = 1
path = os.path.abspath(os.path.dirname(file))for file in os.listdir(path): if is_tar and file.endswith(".tar.gz"): filename.append(file) count += 1 if count = count: print("索引错误") sys.exit() else: tar_path = "/pbox" if argv == "PBox" else "/mnt" os.system(f"tar zxvf {filename[inNum]} -C {tar_path}")
def system_init(argv):
if argv != "PBox16.04":
os.system("cp -rf /mnt/profile /etc/")
if not os.path.isdir("/mnt/FCloudComm"):
print("1")
sys.exit()
if not os.path.isfile("/mnt/run.sh"):
print("2")
sys.exit()if not os.path.isfile("/usr/lib/libiconv.so.2.6.1"): os.system("cp -rf /mnt/FCloudComm/bin/libiconv.so.2.6.1 /usr/lib/") os.system("ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so") os.system("ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so.2") with open("/etc/init.d/rc.local", "r+") as f: lines = f.readlines() f.seek(0) for l in lines: if "source" not in l: f.write(l) f.write("source /mnt/run.sh\n") print("历史数据库安装完成")
def system_init_pbox():
if not os.path.isdir("/pbox/FCloudComm"):
print("1")
sys.exit()
if not os.path.isfile("/pbox/run.sh"):
print("2")
sys.exit()if not os.path.isfile("/usr/lib/libatomic.so.1.0.
解释一下这段代码
这段代码是一个Python脚本,包含两个函数:deploy_package和system_init。主要功能用于自动化部署和初始化Linux系统中的一些组件和文件。
deploy_package函数接收一个参数,作为要安装的组件名称。首先获取当前目录下所有以.tar.gz结尾的文件,如果没有找到任何相关文件,则打印“索引错误”并退出。否则,根据参数值选择部署到不同的目录中,并使用tar命令解压缩指定的.tal.gz文件到目标目录中。
system_init函数有两个版本:其中一个接收一个参数(非PBox16.04),另一个没有参数。这个函数的主要目的是初始化Linux系统,主要包括以下几个方面:
- 复制/mnt/profile到/etc/目录下。
- 检查/mnt/FCloudComm、/mnt/run.sh文件是否存在或已创建。
- 检查/usr/lib/libiconv.so.2.6.1文件是否存在或已创建。
- 最后将source /mnt/run.sh添加到/etc/rc.local中。
如果是system_init_pbox,主要检查/pbox/FCloudComm、/pbox/run.sh文件是否存在或已创建,并检查/usr/lib/libatomic.so.1.0.文件是否存在或已创建。
最后一个if条件可能被中断了,缺少右括号.
-
@ChatGPT 用python重写如下脚本,输出完整代码并给出注释
#!/bin/bash
argv=$1
#deploy=$1
count=0
filename=()
isTar=1
if [ $isTar == "1" ]
thenpath=
cd $(dirname $0);pwd -P
#echo the current path is:$path
for i inls
do
filegz="tar.gz"
if [[ $i == $filegz ]]
then
#echo $i
filename[count]=$i
count=expr $count + 1
fi
done#echo $count
#echo ${filename[@]}
for((n=0;n<${#filename[@]};n++)){
echo -e "\033[40;35m"$n"\033[0m \033[40;32m"${filename[n]}"\033[0m"
}if (("$count" <= "0"));
then
echo "请下载部署包"
exit
elif (("$count" == "1"));
then
if [ $argv == "PBox" ];
then
tar zxvf ${filename[0]} -C /pbox
else
tar zxvf ${filename[0]} -C /mnt
fi
else
echo -e "\033[40;36m 请选择部署包:\033[0m"
read inNum
if (("$inNum" < "0")) || (("$inNum" >= "$count"))
then
echo "索引错误"
exit
else
if [ $argv == "PBox" ];
then
tar zxvf ${filename[0]} -C /pbox
else
tar zxvf ${filename[0]} -C /mnt
fi
fi
fi
fi#echo "解压部署包"
#echo $deploy
#tar -zxvf $deploy
#echo "解压部署包完成"inspect(){
if [ $argv != "PBox16.04" ];
then
cp -rf /mnt/profile /etc/
fi
if [ ! -d "/mnt/FCloudComm" ]
then
echo "1"
exit
fi
if [ ! -f "/mnt/run.sh" ]
then
echo "2"
exit
fiif [ ! -f "/usr/lib/libiconv.so.2.6.1" ]; then cp -rf /mnt/FCloudComm/bin/libiconv.so.2.6.1 /usr/lib/ ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so.2 fi sed -i '/source/d' /etc/init.d/rc.local sed -i '$a source /mnt/run.sh' /etc/init.d/rc.local #taosd &>/dev/null echo "历史数据库安装完成"
}
inspectPBox(){
if [ ! -d "/pbox/FCloudComm" ]
then
echo "1"
exit
fi
if [ ! -f "/pbox/run.sh" ]
then
echo "2"
exit
fiif [ ! -f "/usr/lib/libiconv.so.2.6.1" ]; then cp -rf /pbox/FCloudComm/bin/libiconv.so.2.6.1 /usr/lib/ ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so.2 fi #taosd &>/dev/null echo "历史数据库安装完成"
}
echo "拷贝系统文件"
if [ $argv == "8401d" ];
then
cp -rf ./libstdc++.so.6 /usr/lib/arm-linux-gnueabihf/
cp -rf ./libstdc++.so.6.0.21 /usr/lib/arm-linux-gnueabihf/
fiif [ $argv == "ISG" ];
then
cp -rf ./libstdc++.so.6.0.21 /usr/lib/arm-linux-gnueabihf/
ln -sf /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.21 /usr/lib/arm-linux-gnueabihf/libstdc++.so.6if [ ! -f "/usr/lib/libatomic.so.1.0.0" ];
then
cp -rf /mnt/FCloudComm/bin/libatomic.so.1.0.0 /usr/lib/
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so.1
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so
fi
fiecho "拷贝系统文件完成"
echo -e "\033[40;36m 网口选择 单网(1)双网(2) \033[0m"
read input
#echo $input
if [ $input == "1" ];
then
sed -i 's/NetCardCount = "2"/NetCardCount = "1"/g' /mnt/FCloudComm/bin/pSL_Setting.xml
sed -i '/sleep 1/d' /mnt/FCloudComm/tools/IPCfg
sed -i '/ifconfig eth1 192.168.20.101 netmask 255.255.255.0 up/d' /mnt/FCloudComm/tools/IPCfg
sed -i '/route add default gw 192.168.20.1 dev eth1/d' /mnt/FCloudComm/tools/IPCfg
fi
echo "网口配置完成"#4G函数
echo -e "\033[40;36m 是否支持4G? 否(0)是(1) \033[0m"read -p "" number
if [ $number -eq 0 ];
then
if [ $argv == "8401d" ];
then
sed -i '/active4g.sh/d' /mnt/run.sh
fiif [ $argv == "PBox" ]; then sed -i '/quectel-pppd.sh/d' /pbox/run.sh fi if [ $argv == "PBox16.04" ]; then sed -i '/quectel-pppd.sh/d' /mnt/run.sh fi
fi
if [ $number -eq 1 ];
then
if [ $argv == "8401d" ];
then
sed -i '/active4g.sh/d' /mnt/run.sh
sed -i '/sleep 10/i\sh ./active4g.sh &' /mnt/run.sh
fiif [ $argv == "PBox" ]; then sed -i '/quectel-pppd.sh/d' /pbox/run.sh sed -i '/sleep 10/i\sh ./quectel-pppd.sh &' /pbox/run.sh fi if [ $argv == "PBox16.04" ]; then sed -i '/quectel-pppd.sh/d' /mnt/run.sh sed -i '/sleep 10/i\sh ./quectel-pppd.sh &' /mnt/run.sh fi
fi
if [ $number -ne 1 ] && [ $number -ne 0 ];
then
echo "输入错误"
fiecho "配置开机启动"
if [ $argv == "8401d" ];
then
sed -i '1c #! /bin/bash' /etc/init.d/rc.local
fiif [ $argv == "PBox16.04" ];
then
sed -i '1c #! /bin/bash' /etc/rc.local
fiif [ $argv == "ISG" ];
then
sed -i '1c #! /bin/bash' /etc/init.d/rocktech.sh
sed -i '/source/d' /etc/init.d/rocktech.sh
sed -i '$a source /mnt/run.sh' /etc/init.d/rocktech.sh
sed -i '/source/d' /etc/init.d/rc.local
sed -i "114s:#::g" /etc/init.d/rocktech.sh
fiecho "配置开机启动完成"
echo "初始化本地ip地址"
sed -i 's/address 190.5.20.171/address 192.168.10.101/g' /etc/network/interfaces
sed -i 's/gateway 190.5.200.11/gateway 192.168.10.1/g' /etc/network/interfaces
sed -i 's/address 192.168.1.100/address 192.168.20.101/g' /etc/network/interfaces
sed -i 's/gateway 192.168.1.1/gateway 192.168.20.1/g' /etc/network/interfaces
echo "初始化本地ip地址结束"echo "配置历史数据库"
#td库ISG网关配置
td(){
cd /mnt/TDengine-server-2.0.10.0/
./install.sh &>/dev/null
sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg
sed -i 's/# fqdn/fqdn/g' /etc/taos/taos.cfg
sed -i 's/hostname/localhost/g' /etc/taos/taos.cfg
}#PBox网关配置
PB(){
if [ ! -f "/usr/lib/libatomic.so.1.0.0" ];
then
cp -rf /pbox/FCloudComm/bin/libatomic.so.1.0.0 /usr/lib/
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so.1
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so
fised -i '1c #! /bin/bash' /etc/init.d/rc.local cd /pbox/TDengine-server-2.0.10.0 ./install.sh &>/dev/null sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg sed -i 's/# logDir/ logDir/g' /etc/taos/taos.cfg sed -i 's/# dataDir/ dataDir/g' /etc/taos/taos.cfg sed -i 's#/var/log/taos#/pbox/log#g' /etc/taos/taos.cfg sed -i 's#/var/lib/taos#/pbox/lib#g' /etc/taos/taos.cfg sed -i '/run.sh/d' /etc/rc5.d/S99rmnologin.sh sed -i '$a source /pbox/run.sh' /etc/rc5.d/S99rmnologin.sh
}
power(){
source /mnt/FCloudComm/tools/setEnv.sh
if [ -d "/mnt/config" ];then
#echo "文件夹存在"if [ -f "/mnt/config/hardwareinfo.HID" ];then #echo "文件存在" cp -rf /mnt/config/hardwareinfo.HID /mnt/FCloudComm else #echo "文件不存在" echo "配置完成 请放入HID 和 授权文件" /mnt/FCloudComm/bin/getID fi if [ -f "/mnt/config/"*".lic" ];then #echo "文件存在" cp -rf /mnt/config/*.lic /mnt/FCloudComm/bin else #echo "文件不存在" echo "配置完成 请放入HID 和 授权文件" /mnt/FCloudComm/bin/getID fi else #echo "文件夹不存在" echo "配置完成 请放入HID 和 授权文件" /mnt/FCloudComm/bin/getID fi #echo "配置完成 请放入HID 和 授权文件" #/mnt/FCloudComm/bin/getID
}
powerPBox(){
source /pbox/FCloudComm/tools/setEnv.sh
if [ -d "/pbox/config" ];then
#echo "文件夹存在"if [ -f "/pbox/config/hardwareinfo.HID" ];then #echo "文件存在" cp -rf /pbox/config/hardwareinfo.HID /pbox/FCloudComm else #echo "文件不存在" echo "配置完成 请放入HID 和 授权文件" /pbox/FCloudComm/bin/getID fi if [ -f "/pbox/config/"*".lic" ];then #echo "文件存在" cp -rf /pbox/config/*.lic /pbox/FCloudComm/bin else #echo "文件不存在" echo "配置完成 请放入HID 和 授权文件" /pbox/FCloudComm/bin/getID fi else #echo "文件夹不存在" echo "配置完成 请放入HID 和 授权文件" /pbox/FCloudComm/bin/getID fi #echo "配置完成 请放入HID 和 授权文件" #/pbox/FCloudComm/bin/getID
}
case "$1" in
8401d)
cd /mnt/TDengine-server-2.0.10.0
./install.sh &>/dev/null
sed -i 's#/third/log#log#g' /etc/taos/taos.cfg
sed -i 's#/third/data#data#g' /etc/taos/taos.cfg
sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg
inspect
power
;;
8316)
i="0"
while read path
do
if [ "$path" == "127.0.0.1 GEA-8316-DLK" ];
then
i="1"
fi
done < /etc/hostsif [ "$i" != "1" ]; then sed -i '$a\127.0.0.1 GEA-8316-DLK' /etc/hosts fi cd /mnt/TDengine-server-2.0.10.0 ./install.sh &>/dev/null sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg inspect power ;; ISG) i="0" while read path do if [ "$path" == "127.0.0.1 localhost" ]; then i="1" fi done < /etc/hosts if [ "$i" != "1" ]; then echo "127.0.0.1 localhost"> /etc/hosts fi td inspect power ;; PBox) i="0" while read path do if [ "$path" == "127.0.0.1 imx6ull14x14evk" ]; then i="1" fi done < /etc/hosts if [ "$i" != "1" ]; then echo "127.0.0.1 imx6ull14x14evk"> /etc/hosts fi PB inspectPBox powerPBox ;; PBox16.04) pkexec chown root:root /etc/sudoers /etc/sudoers.d -R td inspect power sed -i '/source/d' /etc/init.d/rc.local sed -i '/source/d' /etc/rc.local sed -i '/sleep 1/isource /mnt/run.sh' /etc/rc.local ;;
esac
-
for culture 说:
@ChatGPT 用python重写如下脚本,输出完整代码并给出注释
#!/bin/bash
argv=$1
#deploy=$1
count=0
filename=()
isTar=1
if [ $isTar == "1" ]
thenpath=
cd $(dirname $0);pwd -P
#echo the current path is:$path
for i inls
do
filegz="tar.gz"
if [[ $i == $filegz ]]
then
#echo $i
filename[count]=$i
count=expr $count + 1
fi
done#echo $count
#echo ${filename[@]}
for((n=0;n echo -e "\033[40;35m"$n"\033[0m \033[40;32m"${filename[n]}"\033[0m"
}if (("$count" then
echo "请下载部署包"
exit
elif (("$count" == "1"));
then
if [ $argv == "PBox" ];
then
tar zxvf ${filename[0]} -C /pbox
else
tar zxvf ${filename[0]} -C /mnt
fi
else
echo -e "\033[40;36m 请选择部署包:\033[0m"
read inNum
if (("$inNum" = "$count"))
then
echo "索引错误"
exit
else
if [ $argv == "PBox" ];
then
tar zxvf ${filename[0]} -C /pbox
else
tar zxvf ${filename[0]} -C /mnt
fi
fi
fi
fi#echo "解压部署包"
#echo $deploy
#tar -zxvf $deploy
#echo "解压部署包完成"inspect(){
if [ $argv != "PBox16.04" ];
then
cp -rf /mnt/profile /etc/
fi
if [ ! -d "/mnt/FCloudComm" ]
then
echo "1"
exit
fi
if [ ! -f "/mnt/run.sh" ]
then
echo "2"
exit
fiif [ ! -f "/usr/lib/libiconv.so.2.6.1" ];
then
cp -rf /mnt/FCloudComm/bin/libiconv.so.2.6.1 /usr/lib/
ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so
ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so.2
fised -i '/source/d' /etc/init.d/rc.local
sed -i '$a source /mnt/run.sh' /etc/init.d/rc.local#taosd &>/dev/null
echo "历史数据库安装完成"}
inspectPBox(){
if [ ! -d "/pbox/FCloudComm" ]
then
echo "1"
exit
fi
if [ ! -f "/pbox/run.sh" ]
then
echo "2"
exit
fiif [ ! -f "/usr/lib/libiconv.so.2.6.1" ];
then
cp -rf /pbox/FCloudComm/bin/libiconv.so.2.6.1 /usr/lib/
ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so
ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so.2
fi#taosd &>/dev/null
echo "历史数据库安装完成"}
echo "拷贝系统文件"
if [ $argv == "8401d" ];
then
cp -rf ./libstdc++.so.6 /usr/lib/arm-linux-gnueabihf/
cp -rf ./libstdc++.so.6.0.21 /usr/lib/arm-linux-gnueabihf/
fiif [ $argv == "ISG" ];
then
cp -rf ./libstdc++.so.6.0.21 /usr/lib/arm-linux-gnueabihf/
ln -sf /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.21 /usr/lib/arm-linux-gnueabihf/libstdc++.so.6if [ ! -f "/usr/lib/libatomic.so.1.0.0" ];
then
cp -rf /mnt/FCloudComm/bin/libatomic.so.1.0.0 /usr/lib/
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so.1
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so
fi
fiecho "拷贝系统文件完成"
echo -e "\033[40;36m 网口选择 单网(1)双网(2) \033[0m"
read input
#echo $input
if [ $input == "1" ];
then
sed -i 's/NetCardCount = "2"/NetCardCount = "1"/g' /mnt/FCloudComm/bin/pSL_Setting.xml
sed -i '/sleep 1/d' /mnt/FCloudComm/tools/IPCfg
sed -i '/ifconfig eth1 192.168.20.101 netmask 255.255.255.0 up/d' /mnt/FCloudComm/tools/IPCfg
sed -i '/route add default gw 192.168.20.1 dev eth1/d' /mnt/FCloudComm/tools/IPCfg
fi
echo "网口配置完成"#4G函数
echo -e "\033[40;36m 是否支持4G? 否(0)是(1) \033[0m"read -p "" number
if [ $number -eq 0 ];
then
if [ $argv == "8401d" ];
then
sed -i '/active4g.sh/d' /mnt/run.sh
fiif [ $argv == "PBox" ];
then
sed -i '/quectel-pppd.sh/d' /pbox/run.sh
fiif [ $argv == "PBox16.04" ];
then
sed -i '/quectel-pppd.sh/d' /mnt/run.sh
fi
fiif [ $number -eq 1 ];
then
if [ $argv == "8401d" ];
then
sed -i '/active4g.sh/d' /mnt/run.sh
sed -i '/sleep 10/i\sh ./active4g.sh &' /mnt/run.sh
fiif [ $argv == "PBox" ];
then
sed -i '/quectel-pppd.sh/d' /pbox/run.sh
sed -i '/sleep 10/i\sh ./quectel-pppd.sh &' /pbox/run.sh
fiif [ $argv == "PBox16.04" ];
then
sed -i '/quectel-pppd.sh/d' /mnt/run.sh
sed -i '/sleep 10/i\sh ./quectel-pppd.sh &' /mnt/run.sh
fi
fiif [ $number -ne 1 ] && [ $number -ne 0 ];
then
echo "输入错误"
fiecho "配置开机启动"
if [ $argv == "8401d" ];
then
sed -i '1c #! /bin/bash' /etc/init.d/rc.local
fiif [ $argv == "PBox16.04" ];
then
sed -i '1c #! /bin/bash' /etc/rc.local
fiif [ $argv == "ISG" ];
then
sed -i '1c #! /bin/bash' /etc/init.d/rocktech.sh
sed -i '/source/d' /etc/init.d/rocktech.sh
sed -i '$a source /mnt/run.sh' /etc/init.d/rocktech.sh
sed -i '/source/d' /etc/init.d/rc.local
sed -i "114s:#::g" /etc/init.d/rocktech.sh
fiecho "配置开机启动完成"
echo "初始化本地ip地址"
sed -i 's/address 190.5.20.171/address 192.168.10.101/g' /etc/network/interfaces
sed -i 's/gateway 190.5.200.11/gateway 192.168.10.1/g' /etc/network/interfaces
sed -i 's/address 192.168.1.100/address 192.168.20.101/g' /etc/network/interfaces
sed -i 's/gateway 192.168.1.1/gateway 192.168.20.1/g' /etc/network/interfaces
echo "初始化本地ip地址结束"echo "配置历史数据库"
#td库ISG网关配置
td(){
cd /mnt/TDengine-server-2.0.10.0/
./install.sh &>/dev/null
sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg
sed -i 's/# fqdn/fqdn/g' /etc/taos/taos.cfg
sed -i 's/hostname/localhost/g' /etc/taos/taos.cfg
}#PBox网关配置
PB(){
if [ ! -f "/usr/lib/libatomic.so.1.0.0" ];
then
cp -rf /pbox/FCloudComm/bin/libatomic.so.1.0.0 /usr/lib/
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so.1
ln -sf /usr/lib/libatomic.so.1.0.0 /usr/lib/libatomic.so
fised -i '1c #! /bin/bash' /etc/init.d/rc.local
cd /pbox/TDengine-server-2.0.10.0
./install.sh &>/dev/null
sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg
sed -i 's/# logDir/ logDir/g' /etc/taos/taos.cfg
sed -i 's/# dataDir/ dataDir/g' /etc/taos/taos.cfg
sed -i 's#/var/log/taos#/pbox/log#g' /etc/taos/taos.cfg
sed -i 's#/var/lib/taos#/pbox/lib#g' /etc/taos/taos.cfgsed -i '/run.sh/d' /etc/rc5.d/S99rmnologin.sh
sed -i '$a source /pbox/run.sh' /etc/rc5.d/S99rmnologin.sh
}power(){
source /mnt/FCloudComm/tools/setEnv.sh
if [ -d "/mnt/config" ];then
#echo "文件夹存在"if [ -f "/mnt/config/hardwareinfo.HID" ];then
#echo "文件存在"
cp -rf /mnt/config/hardwareinfo.HID /mnt/FCloudComm
else
#echo "文件不存在"
echo "配置完成 请放入HID 和 授权文件"
/mnt/FCloudComm/bin/getID
fiif [ -f "/mnt/config/"".lic" ];then
#echo "文件存在"
cp -rf /mnt/config/.lic /mnt/FCloudComm/bin
else
#echo "文件不存在"
echo "配置完成 请放入HID 和 授权文件"
/mnt/FCloudComm/bin/getID
fielse
#echo "文件夹不存在"
echo "配置完成 请放入HID 和 授权文件"
/mnt/FCloudComm/bin/getID
fi
#echo "配置完成 请放入HID 和 授权文件"
#/mnt/FCloudComm/bin/getID
}powerPBox(){
source /pbox/FCloudComm/tools/setEnv.sh
if [ -d "/pbox/config" ];then
#echo "文件夹存在"if [ -f "/pbox/config/hardwareinfo.HID" ];then
#echo "文件存在"
cp -rf /pbox/config/hardwareinfo.HID /pbox/FCloudComm
else
#echo "文件不存在"
echo "配置完成 请放入HID 和 授权文件"
/pbox/FCloudComm/bin/getID
fiif [ -f "/pbox/config/"".lic" ];then
#echo "文件存在"
cp -rf /pbox/config/.lic /pbox/FCloudComm/bin
else
#echo "文件不存在"
echo "配置完成 请放入HID 和 授权文件"
/pbox/FCloudComm/bin/getID
fielse
#echo "文件夹不存在"
echo "配置完成 请放入HID 和 授权文件"
/pbox/FCloudComm/bin/getID
fi
#echo "配置完成 请放入HID 和 授权文件"
#/pbox/FCloudComm/bin/getID
}case "$1" in
8401d)
cd /mnt/TDengine-server-2.0.10.0
./install.sh &>/dev/null
sed -i 's#/third/log#log#g' /etc/taos/taos.cfg
sed -i 's#/third/data#data#g' /etc/taos/taos.cfg
sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg
inspect
power
;;
8316)
i="0"
while read path
do
if [ "$path" == "127.0.0.1 GEA-8316-DLK" ];
then
i="1"
fi
done
if [ "$i" != "1" ];
then
sed -i '$a\127.0.0.1 GEA-8316-DLK' /etc/hosts
ficd /mnt/TDengine-server-2.0.10.0 ./install.sh &>/dev/null sed -i 's/firstEp/#firstEp/g' /etc/taos/taos.cfg inspect power ;;
ISG)
i="0"
while read path
do
if [ "$path" == "127.0.0.1 localhost" ];
then
i="1"
fi
done
if [ "$i" != "1" ];
then
echo "127.0.0.1 localhost"> /etc/hosts
fitd inspect power ;;
PBox)
i="0"
while read path
do
if [ "$path" == "127.0.0.1 imx6ull14x14evk" ];
then
i="1"
fi
done
if [ "$i" != "1" ];
then
echo "127.0.0.1 imx6ull14x14evk"> /etc/hosts
fi
PB
inspectPBox
powerPBox
;;
PBox16.04)
pkexec chown root:root /etc/sudoers /etc/sudoers.d -R
td
inspect
power
sed -i '/source/d' /etc/init.d/rc.local
sed -i '/source/d' /etc/rc.local
sed -i '/sleep 1/isource /mnt/run.sh' /etc/rc.local
;;
esac以下是Python版的代码和注释:
#!/usr/bin/python3 import os import shutil import subprocess def inspect(): # 用于安装历史数据库和权限文件等等操作 if deploy != "PBox16.04": # 复制profile文件 shutil.copy("/mnt/profile", "/etc/") # 判断历史数据库文件夹是否存在 # 若不存在,则返回错误信息 if not os.path.exists("/mnt/FCloudComm"): print("1") return # 判断run.sh是否存在 # 若不存在,则返回错误信息 elif not os.path.exists("/mnt/run.sh"): print("2") return # 若libiconv.so.2.6.1文件不存在 # 则将该文件复制到/usr/lib/下,并建立软链接 if not os.path.exists("/usr/lib/libiconv.so.2.6.1"): shutil.copy("/mnt/FCloudComm/bin/libiconv.so.2.6.1", "/usr/lib/") os.system("ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so") os.system("ln -sf /usr/lib/libiconv.so.2.6.1 /usr/lib/libiconv.so.2") # 将run.sh脚本配置到开机启动项中 subprocess.call("sed -i '/source/d' /etc/init.d/rc.local", shell=True) subprocess.call("sed -i '$a source /mnt/run.sh' /etc/init.d/rc.local", shell=True) # 执行完成后,输出提示信息 print("历史数据库安装完成") # 定义函数,用于安装历史数据库和权限文件等等操作(针对PBox版本) def inspectPBox(): # 判断历史数据库文件夹是否存在 # 若不存在,则返回错误信息 if not os.path.exists("/pbox/FCloudComm"): print("1") return # 判断run.sh是否存在 # 若不存在,则返回错误信息 elif not os.path.exists("/pbox/run.sh"): print("2") return # 若libiconv.so.2.6.1文件不存在 # 则将该文件复制到/usr/lib/下,并建立软链接 if not os.path.exists("/usr/lib/libiconv.so.2.6.1"): shutil.copy("/pbox/FCloudComm/bin/libiconv.so.2.6.1", "/usr/lib/") os.system("ln -sf
-
scintist 说:
@ChatGPT 如何理解“中国经济韧性强、潜力大、活力足,长期向好的基本面依然不变”
这段话是对中国经济的一种评估和描述。它可以这样理解:
首先,“中国经济韧性强”,意味着中国经济在面对不利因素时有硬抗风险、储备力量充足的能力。在全球经济增速放缓、贸易摩擦等因素带来的冲击下,中国经济仍然保持了稳定发展,这就是“韧性强”的表现。
其次,“潜力大”,意味着中国经济还有很大的发展空间,尤其是在新技术、新产业、新业态、新模式等方面,有很多未来的发展机会和潜力。这意味着中国经济还有很大的上升空间和发展潜力。
再次,“活力足”,意味着中国经济具有强大的动力和活力,为未来发展注入了新能量和动力。例如,中国政府推动的供给侧改革和创新驱动发展,这些措施都在推动经济的发展,并培育了许多新的经济领域和新的潜力点。
最后,“长期向好的基本面依然不变”,意味着中国经济长期向好的趋势没有改变。中国经济在过去几十年的发展已经证明了其能够在全球市场中稳健增长,在未来,中国经济的增长趋势将继续延续。这一点对于国内外投资者来说是非常重要的信号。
-
scintist 说:
@ChatGPT 如何理解“要保持强烈的忧患意识、风险意识,加强对各种风险隐患的研判,做足预案,下好先手棋,打好主动仗,及时精准拆弹,增强防范化解风险的意识和本领”
上述言论意思是,在日常生活中,我们应该始终保持警觉和警惕,认识到存在各种潜在的风险和隐患。我们应该积极主动地研判、识别和评估风险和隐患,制定相应的应对预案,提高自己的应对能力,在遇到风险和挑战时能够做出恰当的反应。
为了实现这个目标,我们需要先了解和认知到潜在的各种风险和隐患,然后加强对其进行研究和分析,在做好防范措施的基础上,建立应对预案,即“先手棋”,以及时、精准地应对,化解各种风险。
同时,我们应该意识到,防范和化解风险是一项不断演进和持续改进的过程,需要不断加强学习、总结和反思,不断提高自身的风险管理能力,保持强烈的警惕性和适应性,才能更好地应对各种挑战和风险。