-
-
Save jnahorny/87405dede7daadc0d4201cf64c38241a to your computer and use it in GitHub Desktop.
r2pm -- init|update
This file contains 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
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