forked from spinesystemspublic/documentation
Documentation minor update
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
This commit is contained in:
@@ -79,3 +79,25 @@ If you see accel-pppd process you can start it with:
|
|||||||
/usr/sbin/accel-pppd -c /etc/accel-ppp.conf -p /var/run/accel-ppp.pid -d
|
/usr/sbin/accel-pppd -c /etc/accel-ppp.conf -p /var/run/accel-ppp.pid -d
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Shell tricks
|
||||||
|
|
||||||
|
For example i want to filter all lines that begin with "fadi" in users list:
|
||||||
|
```
|
||||||
|
accel-cmd show sessions username|grep "^ fadi"
|
||||||
|
```
|
||||||
|
What does it mean and how it works?
|
||||||
|
|
||||||
|
* accel-cmd show sessions username - will show all sessions, but username field will be shown only
|
||||||
|
* | - pipe, it will pass output of previous command to next command
|
||||||
|
* grep "^ fadi" - will filter only lines that begin with " fadi", symbol ^ means beginning of line, space is needed to filter accel-specific output (it has space before username)
|
||||||
|
|
||||||
|
Now, for example i want to save this list and disconnect all users that begin with "fadi":
|
||||||
|
```
|
||||||
|
accel-cmd show sessions username|grep "^ fadi"|awk '{print $1}'|xargs -I {} accel-cmd terminate username {}
|
||||||
|
```
|
||||||
|
|
||||||
|
What does it mean and how it works?
|
||||||
|
|
||||||
|
* awk '{print $1}' - will print first field of each line, which is username, it will remove leading space
|
||||||
|
* xargs -I {} - will pass each line to next command, {} is placeholder for line(variable)
|
||||||
|
* accel-cmd terminate username {} - will disconnect user by username
|
||||||
|
|||||||
Reference in New Issue
Block a user