Skip to content

Commit

Permalink
chore: check kernel version in shell script
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeldtinoco committed Aug 6, 2024
1 parent bbc9be1 commit e8cfc6d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Read about the [theory](https://listendev.github.io/argus/dev/overview/theory/)
Best way to try argus out, for now, is to use the provided docker container image, like described below, and check the stdout file (`/var/log/argus/argus.log`) for the detections output.

```shell
curl -s https://raw.githubusercontent.com/listendev/argus-releases/main/argus.sh | sh -
curl -s https://listendev.github.io/argus/dev/argus.sh | sh
```

### GitHub Integration
Expand Down
20 changes: 20 additions & 0 deletions argus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,27 @@ clean() {
sudo rm -f $STDOUT $STDERR $EVENTS
}

kernelver() {
major=$(uname -r | cut -d'-' -f1 | cut -d '.' -f1)
minor=$(uname -r | cut -d'-' -f1 | cut -d '.' -f2)
supported=1
if [[ $major -eq 5 || $major -eq 6 ]]; then
if [[ $major -eq 5 ]]; then
if [[ $minor -lt 15 ]]; then
supported=0
fi
fi
else
supported=0
fi
if [[ $supported -eq 0 ]]; then
echo "kernel version $(uname -r) not supported"
exit 1
fi
}

requirements() {
kernelver
sudo mkdir -p $LOGDIR
clean
}
Expand Down

0 comments on commit e8cfc6d

Please sign in to comment.