generated from pavel.muhortov/template-bash
deleted wg-connect-handling.sh
This commit is contained in:
parent
1c1b787d54
commit
ec2defdec5
49
README.md
49
README.md
|
@ -129,55 +129,6 @@ tail -f /var/log/wireguard/wg.log
|
||||||
|
|
||||||
____
|
____
|
||||||
|
|
||||||
## `wg-connect-handling`.sh
|
|
||||||
|
|
||||||
**Description:**
|
|
||||||
> Handling client connection and preparing stats for monitoring.
|
|
||||||
|
|
||||||
**Dependencies:**
|
|
||||||
>
|
|
||||||
> * privileged rights
|
|
||||||
> * [jq](https://github.com/stedolan/jq) (tested version 1.6 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
|
|
||||||
> * [grepcidr](https://github.com/ryantig/grepcidr) (tested version 2.0 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
|
|
||||||
> * [Python 3](https://www.python.org/downloads/) (tested version 3.9.5 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
|
|
||||||
> * existing [/usr/local/bin/sendmail.py](https://git.hmp.today/pavel.muhortov/utils#sendmail-py)
|
|
||||||
> * [bash](https://www.gnu.org/software/bash/) (tested versions: 5.1.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/), 5.0.17 on [Ubuntu 20](https://wiki.ubuntu.com/FocalFossa/ReleaseNotes), 4.2.46 on [CentOS 7](https://wiki.centos.org/Manuals/ReleaseNotes/CentOS7.2009))
|
|
||||||
|
|
||||||
| POSITION | PARAMETERS | DESCRIPTION | DEFAULT |
|
|
||||||
|-----------|--------------|------------------------|---------------|
|
|
||||||
| 1 |**</path/to/dir>**|root path for counter, names, log|**REQUIRED**|
|
|
||||||
| 2 |**[mail]**|send email notification||
|
|
||||||
| 3 |**[geo]**|check client address geolocation||
|
|
||||||
|
|
||||||
Example usage:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# download
|
|
||||||
sudo wget https://git.hmp.today/pavel.muhortov/wireguard-management/raw/branch/master/wg-connect-handling.sh -O /etc/wireguard/wg-connect-handling.sh
|
|
||||||
sudo chmod +x /etc/wireguard/wg-connect-handling.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# create root path for counter, names, log
|
|
||||||
sudo mkdir /var/log/wireguard
|
|
||||||
sudo chown -R root:root /var/log/wireguard
|
|
||||||
sudo chmod -R 755 /var/log/wireguard
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# sudo crontab -e
|
|
||||||
* * * * * bash /etc/wireguard/wg-connect-handling.sh /var/log/wireguard mail geo
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# check counter and names
|
|
||||||
watch cat /var/log/wireguard/wg-counts.log
|
|
||||||
# check journal
|
|
||||||
tail -f /var/log/wireguard/wg-connect-handling.log
|
|
||||||
```
|
|
||||||
|
|
||||||
____
|
|
||||||
|
|
||||||
## `wg-heavy@wg1`.service
|
## `wg-heavy@wg1`.service
|
||||||
|
|
||||||
**Description:**
|
**Description:**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user