Commit 6a9418b3 by liyapeng

ceshi

1 parent 3e6d0cce
Showing with 13 additions and 15 deletions
...@@ -16,21 +16,19 @@ operation() { ...@@ -16,21 +16,19 @@ operation() {
echo "[5]done" echo "[5]done"
} }
main() { if [ $(whoami) != "root" ]; then
if [ $(whoami) != "root" ]; then echo " only root can run me"
echo " only root can run me" exit 1
else
#判断是否存在wget、curl
check_wget=$(which wget)
if [ $? -ne 0 ]; then
echo -e "\e[33mwget command not found!\e[0m"
echo -e "\e[33mPlease install wget to run this script.\e[0m"
echo -e "\e[33mInstall wget to run command: apt-get update -y && apt-get install wget -y\e[0m"
exit 1 exit 1
else else
#判断是否存在wget、curl wget -q ${LOG_COLLECT_FILE_URL} >>/dev/null
check_wget=$(which wget) operation
if [ $? -ne 0 ]; then
echo -e "\e[33mwget command not found!\e[0m"
echo -e "\e[33mPlease install wget to run this script.\e[0m"
echo -e "\e[33mInstall wget to run command: apt-get update -y && apt-get install wget -y\e[0m"
exit 1
else
wget -q ${LOG_COLLECT_FILE_URL} >>/dev/null
operation
fi
fi fi
} fi
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!