Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
liyapeng
/
log_collect
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6a9418b3
authored
Oct 13, 2023
by
liyapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceshi
1 parent
3e6d0cce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
adl_log_collect.sh
adl_log_collect.sh
View file @
6a9418b
...
@@ -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
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment