Files
AFLplusplus/frida_mode/update_frida_version.sh
Vincent Andrae af11b80fda Enhance compatibility in update_frida_version.sh
Modify sed command to support FreeBSD and macOS
2024-12-18 17:50:55 +01:00

20 lines
726 B
Bash
Executable File

#!/bin/sh
test -n "$1" && { echo This script has no options. It updates the referenced Frida version in GNUmakefile to the most current one. ; exit 1 ; }
OLD=$(grep -E '^GUM_DEVKIT_VERSION=' GNUmakefile 2>/dev/null|awk -F= '{print$2}')
NEW=$(curl https://github.com/frida/frida/releases/ 2>/dev/null|grep 'Frida\ [0-9.]*'|head -n 1|sed 's/.*Frida\ //'| sed 's/<\/h2>//')
echo Current set version: $OLD
echo Newest available version: $NEW
test -z "$OLD" -o -z "$NEW" -o "$OLD" = "$NEW" && { echo Nothing to be done. ; exit 0 ; }
# Determine the correct sed command
case $(sed --help 2>&1) in
*GNU*) set sed -i;;
*) set sed -i '';;
esac
"$@" "s/=$OLD/=$NEW/" GNUmakefile || exit 1
echo Successfully updated GNUmakefile