Files
vim-ale/vps-utils/cap-net-bind.sh
2020-07-01 04:52:03 +00:00

18 lines
314 B
Bash

#!/bin/bash
{
set -e
set -u
my_bin="$1"
if [ -z "$(which $my_bin)"]; then
echo "'$my_bin' not found"
exit 1
fi
my_sudo=""
if [ -n "$(command -v sudo)" ]; then
my_sudo=sudo
fi
$my_sudo setcap 'cap_net_bind_service=+ep' $(readlink -f $(which $my_bin))
}