Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
7e01d87b
Commit
7e01d87b
authored
Dec 17, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distr_info: check if proc exists before use
parent
5c2f9442
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
distr_info
bin/distr_info
+2
-1
No files found.
bin/distr_info
View file @
7e01d87b
...
...
@@ -420,6 +420,7 @@ esac
echo
"
$DIST_BIT
"
}
# TODO: check before calc
get_memory_size
()
{
local
detected
=
0
local
DIST_OS
=
$(
get_base_os_name
)
...
...
@@ -431,7 +432,7 @@ get_memory_size() {
detected
=
$((
`
sysctl hw.physmem |
sed
s/
"hw.physmem: "
//
`
/
1024
/
1024
))
elif
[
$DIST_OS
=
"linux"
]
then
detected
=
$((
`
cat
/proc/meminfo |
grep
MemTotal |
awk
'{print $2}'
`
/
1024
))
[
-r
/proc/meminfo
]
&&
detected
=
$((
`
cat
/proc/meminfo |
grep
MemTotal |
awk
'{print $2}'
`
/
1024
))
fi
# Exit codes only support values between 0 and 255. So use stdout.
echo
$detected
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment