Created
October 22, 2013 15:10
-
-
Save MgaMPKAy/7102420 to your computer and use it in GitHub Desktop.
Toggle ptrace by setting /proc
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
toggle_ptrace() { | |
local enable | |
mapfile -t enable < /proc/sys/kernel/yama/ptrace_scope | |
enable=${enable[0]} | |
if [[ $enable == '0' ]]; then | |
enable=1 | |
else | |
enable=0 | |
fi | |
sudo sh -c "echo $enable > /proc/sys/kernel/yama/ptrace_scope" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment