脚本_安装程序.sh
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了脚本_安装程序.sh相关的知识,希望对你有一定的参考价值。
This is a simple script which downloads the latest "LoRa Server" files from the repository of the user brocaar in GitHub.Just make the file executable with a "chmod +x script_installer.sh" and run it, the program will give you the latest releases of the main files according to your OS.
#!/bin/bash clear screen echo "Choose your Opertaing System:" echo "1) Linux 32-bit" echo "2) Linux 64-bit" echo "3) Linux ARM" echo "4) MS Windows 32-bit" echo "5) MS Windows 64-bit" echo "6) Darwin OS" read OS case $OS in 1) echo "Linux 32-bit is selected" OS2=$"_linux_386.tar.gz" OS_Linux="yes" ;; 2) echo "Linux 64-bit is selected" OS2=$"_linux_amd64.tar.gz" OS_Linux="yes" ;; 3) echo "Linux ARM is selected" OS2=$"_linux_arm.tar.gz" OS_Linux="yes" ;; 4) echo "MS Windows 32-bit is selected" OS2=$"_windows_386.tar.gz" OS_Linux="no" ;; 5) echo "MS Windows 64-bit is selected" OS2=$"_windows_amd64.tar.gz" OS_Linux="no" ;; 6) echo "Darwin OS is selected" OS2=$"_darwin_amd64.tar.gz" OS_Linux="no" ;; *) echo "invalid option" exit ;; esac Link1=$(wget https://github.com/brocaar/loraserver/releases/latest > /dev/null 2>&1; cat latest | grep $OS2 | grep href) Link2=$(echo $Link1 | awk -F'" rel=' '{print $1}' | awk -F '="' '{print $2}') echo https://github.com${Link2} rm latest wget https://github.com${Link2} Link1=$(wget https://github.com/brocaar/lora-gateway-bridge/releases/latest > /dev/null 2>&1; cat latest | grep $OS2 | grep href) Link2=$(echo $Link1 | awk -F'" rel=' '{print $1}' | awk -F '="' '{print $2}') echo https://github.com${Link2} rm latest wget https://github.com${Link2} Link1=$(wget https://github.com/brocaar/lora-app-server/releases/latest > /dev/null 2>&1; cat latest | grep $OS2 | grep href) Link2=$(echo $Link1 | awk -F'" rel=' '{print $1}' | awk -F '="' '{print $2}') echo https://github.com${Link2} rm latest wget https://github.com${Link2} for a in *.tar.gz; do echo working on $a; tar zxvf $a; done for b in *.tar.gz; do rm -v $b; done if [ "$OS_Linux" = 'yes' ]; then echo "Linux files detected. Attempting giving executable permission..." chmod +x loraserver lora-gateway-bridge lora-app-server echo "Done." fi
以上是关于脚本_安装程序.sh的主要内容,如果未能解决你的问题,请参考以下文章
sh 一个片段,可以帮助您在rc脚本中找到“source”的时间成本
shell脚本检测当前用户是否为超级管理员===checkRoot.sh