Skip to content

Commit 4108ed2

Browse files
authored
Merge pull request #2520 from xgqt/2024-0-refactor-misc-shell-script-tweaks
refactor misc shell script tweaks
2 parents 0d436ab + 9f371cc commit 4108ed2

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

goodies/check_conditional_tests

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

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

6-
grep "#[ \t]*if" $(find . -name "*.[ch]") | \
6+
declare -a c_src_files=()
7+
mapfile -t c_src_files < <(find . -name "*.[ch]")
8+
9+
grep "#[ \t]*if" "${c_src_files[@]}" | \
710
grep -v "_H$" | \
811
sed -e "s/.*://" | \
912
sed -e "s/#ifn*def *//" -e "s/#if *//" | \

snap-tools/keepalived-wrapper

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/sh
22

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

2424
# The magic file must be the one in the snap
25-
export MAGIC=${SNAP}/usr/share/misc/magic
25+
MAGIC="${SNAP}/usr/share/misc/magic"
26+
export MAGIC
2627

27-
exec ${SNAP}/usr/sbin/${BINARY} "$@"
28+
exec "${SNAP}/usr/sbin/${BINARY}" "$@"

0 commit comments

Comments
 (0)