This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function ensure_privileged_or_exit() { | |
local cap_mask="0x00000007ffffffff" | |
local cap_bnd=0x$(grep ^CapBnd /proc/self/status | awk '{print $2}') | |
if [[ $(($cap_mask & $cap_bnd )) != $(($cap_mask)) ]]; then | |
echo -e "[ERROR] Run with --privileged option." | |
exit 1 | |
fi | |
} |