Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
scripts: Add next-kernel-number
add scripts/next-kernel-number which just outputs the next free kernel
build number.
  • Loading branch information
donald committed Apr 27, 2022
1 parent fd05069 commit 2241e43
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions scripts/next-kernel-number
@@ -0,0 +1,20 @@
#! /bin/bash

max=0
max_name=""

cd /src/mariux/beeroot/bee-files/

for f in linux-[0-9]*.bee; do
[[ $f =~ -([0-9]+).bee ]] || continue
if (( ${BASH_REMATCH[1]} > $max )); then
max=${BASH_REMATCH[1]}
max_name="$f"
fi
done
if [ -n "$max_name" ]; then
echo $(($max+1))
else
echo "No file linux-[0-9]*.bee found in /src/mariux/beeroot/bee-files/" >&1
exit 1
fi

0 comments on commit 2241e43

Please sign in to comment.