Use bash binary from env instead of /bin/bash for scripts

It's not possible to run any of the scripts on distributions which do
have `bash` not in `/bin`. This is being fixed by using `/usr/bin/env
bash` instead.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
This commit is contained in:
Sascha Grunert
2020-08-17 09:18:02 +02:00
parent 96fb5dc94d
commit ba9f18e2b8
61 changed files with 65 additions and 62 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -euxo pipefail
# returned path can vary: /usr/bin/dnf /bin/dnf ...

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# N/B: This script could mega f*!@up your disks if run by mistake.
# it is left without the execute-bit on purpose!

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
source $(dirname $0)/lib.sh

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eo pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -xeo pipefail
export GOPATH=/var/tmp/go

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -376,7 +376,7 @@ install_scl_git() {
echo "Installing SoftwareCollections updated 'git' version."
ooe.sh $SUDO yum -y install rh-git29
cat << "EOF" | $SUDO tee /usr/bin/git
#!/bin/bash
#!/usr/bin/env bash
scl enable rh-git29 -- git $@
EOF

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Unit tests for some functions in lib.sh
#

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script attempts basic confirmation of functional networking
# by connecting to a set of essential external servers and failing

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script executes a command while logging all output to a temporary
# file. If the command exits non-zero, then all output is sent to the console,

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# N/B: This script is not intended to be run by humans. It is used to configure the
# fedora base image for importing, so that it will boot in GCE

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script is called from fedora_setup.sh and various Dockerfiles.
# It's not intended to be used outside of those contexts. It assumes the lib.sh

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script is called by packer on the subject fedora VM, to setup the podman
# build/test environment. It's not intended to be used outside of this context.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script is called by packer on a vanilla CentOS VM, to setup the image
# used for building images FROM base images. It's not intended to be used

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script is utilized by Makefile, it's not intended to be run by humans

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# N/B: This script is not intended to be run by humans. It is used to configure the
# fedora base image for importing, so that it will boot in GCE

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set +e # Not all of these exist on every platform

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script is called from ubuntu_setup.sh and various Dockerfiles.
# It's not intended to be used outside of those contexts. It assumes the lib.sh

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script is called by packer on the subject Ubuntu VM, to setup the podman
# build/test environment. It's not intended to be used outside of this context.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script is called by packer on the subject fedora VM, to setup the podman
# build/test environment. It's not intended to be used outside of this context.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
source $(dirname $0)/lib.sh

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
source $(dirname $0)/lib.sh

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eo pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,5 +1,6 @@
#!/bin/bash -e
#!/usr/bin/env bash
# Assemble remote man pages for darwin or windows from markdown files
set -e
PLATFORM=$1 ## linux, windows or darwin
TARGET=${2} ## where to output files

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
if pkg-config libapparmor 2> /dev/null ; then
echo apparmor
fi

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
cc -E - > /dev/null 2> /dev/null << EOF
#include <btrfs/ioctl.h>
EOF

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
cc -E - > /dev/null 2> /dev/null << EOF
#include <btrfs/version.h>
EOF

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
if ! [ $(id -u) = 0 ]; then
echo "Please run as root! '$@' requires root privileges."
exit 1

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script produces various bits of metadata needed by Makefile. Using
# a script allows uniform behavior across multiple environments and

View File

@ -1,6 +1,7 @@
#!/bin/bash -e
#!/usr/bin/env bash
# Need to run linter twice to cover all the build tags code paths
set -e
declare -A BUILD_TAGS
# TODO: add systemd tag

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,7 +1,8 @@
#!/bin/bash -e
#!/usr/bin/env bash
BASE_PATH="/usr/libexec/podman"
CATATONIT_PATH="${BASE_PATH}/catatonit"
CATATONIT_VERSION="v0.1.4"
set -e
if [ -f $CATATONIT_PATH ]; then
echo "skipping ... catatonit is already installed"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
tmpdir="$PWD/tmp.$RANDOM"
mkdir -p "$tmpdir"
trap 'rm -fr "$tmpdir"' EXIT

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# man-page-checker - validate and cross-reference man page names
#

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Compare commands listed by 'podman help' against those in 'man podman'.
# Recurse into subcommands as well.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# podman-try - try running a command via PODMAN1; use PODMAN2 as fallback
#

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
if pkg-config libselinux 2> /dev/null ; then
echo selinux
fi

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
SUGGESTION="${SUGGESTION:-sync the vendor.conf and commit all changes.}"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Usage: test-apiv2 [PORT]
#

View File

@ -23,7 +23,7 @@ load helpers
# as a user, the parent directory must be world-readable.
test_script=$PODMAN_TMPDIR/fail-if-writable
cat >$test_script <<"EOF"
#!/bin/bash
#!/usr/bin/env bash
path="$1"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# regression tests for helpers.bash
#

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# test_podman_baseline.sh
# A script to be run at the command line with Podman installed.
# This should be run against a new kit to provide base level testing
@ -215,7 +215,7 @@ podman run $image ls /
########
FILE=./runecho.sh
/bin/cat <<EOM >$FILE
#!/bin/bash
#!/usr/bin/env bash
for i in {1..9};
do
echo "This is a new container pull ipbabble [" \$i "]"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# test_podman_build.sh
#

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# test_podman_pods.sh
# A script to be run at the command line with Podman installed.
# This should be run against a new kit to provide base level testing