mirror of
https://github.com/springzfx/cgproxy.git
synced 2026-04-23 10:11:04 +08:00
add run_in_cgroup script for other easy use
This commit is contained in:
10
cgproxy.sh
10
cgproxy.sh
@@ -5,8 +5,12 @@ source $config
|
||||
|
||||
# test suid bit
|
||||
if [ -u "$(which cgattach)" ]; then
|
||||
cgattach $$ $proxy_cgroup
|
||||
cgattach $$ $proxy_cgroup && attached=1
|
||||
else
|
||||
sudo cgattach $$ $proxy_cgroup
|
||||
sudo cgattach $$ $proxy_cgroup && attached=1
|
||||
fi
|
||||
$@
|
||||
|
||||
# test attach success or not
|
||||
[[ -z "$attached" ]] && echo "config error" && exit 1
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user