Skip to content

Commit

Permalink
Merge pull request #2520 from xgqt/2024-0-refactor-misc-shell-script-…
Browse files Browse the repository at this point in the history
…tweaks

refactor misc shell script tweaks
  • Loading branch information
pqarmitage authored Dec 19, 2024
2 parents 0d436ab + 9f371cc commit 4108ed2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions goodies/check_conditional_tests
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash
#!/usr/bin/env bash

# Get a count of each defined term used in #if directives
# This can be useful to check for typos in the names

grep "#[ \t]*if" $(find . -name "*.[ch]") | \
declare -a c_src_files=()
mapfile -t c_src_files < <(find . -name "*.[ch]")

grep "#[ \t]*if" "${c_src_files[@]}" | \
grep -v "_H$" | \
sed -e "s/.*://" | \
sed -e "s/#ifn*def *//" -e "s/#if *//" | \
Expand Down
7 changes: 4 additions & 3 deletions snap-tools/keepalived-wrapper
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh

MAJ_VER=$(uname -r | cut -d'.' -f1)
MIN_VER=$(uname -r | cut -d'.' -f2)
Expand All @@ -22,6 +22,7 @@ exit 1
fi

# The magic file must be the one in the snap
export MAGIC=${SNAP}/usr/share/misc/magic
MAGIC="${SNAP}/usr/share/misc/magic"
export MAGIC

exec ${SNAP}/usr/sbin/${BINARY} "$@"
exec "${SNAP}/usr/sbin/${BINARY}" "$@"

0 comments on commit 4108ed2

Please sign in to comment.