Skip to content

Instantly share code, notes, and snippets.

@jnahorny
Created June 12, 2016 10:58
Show Gist options
  • Save jnahorny/87405dede7daadc0d4201cf64c38241a to your computer and use it in GitHub Desktop.
Save jnahorny/87405dede7daadc0d4201cf64c38241a to your computer and use it in GitHub Desktop.
r2pm -- init|update
case "$1" in
init|update)
R2PM_DBDIR="${HOME}/.config/radare2/r2pm/db"
mkdir -p "${R2PM_USRDIR}"/git
cd "${R2PM_USRDIR}"/git
if [ -d radare2-pm ]; then
cd radare2-pm
git pull || exit 1
else
git clone https://github.com/radare/radare2-pm || exit 1
cd radare2-pm
fi
rm -f "${R2PM_DBDIR}"
rm -f "${R2PM_DBDIR}/*"
rmdir "${R2PM_DBDIR}"
rm -f "${R2PM_DBDIR}"
ln -fs "${R2PM_USRDIR}"/git/radare2-pm/db "${R2PM_DBDIR}" || exit 1
echo "r2pm database initialized. Use 'r2pm update' to update"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment