Changed shebangs to be portable

I did this because hardcoding /bin/bash is generally not good practice
This commit is contained in:
Logan G 2020-09-03 01:20:38 -06:00
parent 3f556a1147
commit d224b02031
Signed by: logan
GPG key ID: E328528C921E7A7A
31 changed files with 58 additions and 31 deletions

View file

@ -1,4 +1,5 @@
#!/bin/bash -eu #!/usr/bin/env bash
set -eu
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BUILD_OPTS="$*" BUILD_OPTS="$*"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
# shellcheck disable=SC2119 # shellcheck disable=SC2119
run_sub_stage() run_sub_stage()
{ {

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
if [ ! -x "${ROOTFS_DIR}/usr/bin/qemu-arm-static" ]; then if [ ! -x "${ROOTFS_DIR}/usr/bin/qemu-arm-static" ]; then
cp /usr/bin/qemu-arm-static "${ROOTFS_DIR}/usr/bin/" cp /usr/bin/qemu-arm-static "${ROOTFS_DIR}/usr/bin/"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
on_chroot << EOF on_chroot << EOF
apt-get update apt-get update

View file

@ -1,3 +1,4 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
install -m 644 files/resolv.conf "${ROOTFS_DIR}/etc/" install -m 644 files/resolv.conf "${ROOTFS_DIR}/etc/"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.info" INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.info"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}" NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}" NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
install -m 644 files/sources.list "${ROOTFS_DIR}/etc/apt/" install -m 644 files/sources.list "${ROOTFS_DIR}/etc/apt/"
install -m 644 files/raspi.list "${ROOTFS_DIR}/etc/apt/sources.list.d/" install -m 644 files/raspi.list "${ROOTFS_DIR}/etc/apt/sources.list.d/"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
if [ ! -d "${ROOTFS_DIR}" ]; then if [ ! -d "${ROOTFS_DIR}" ]; then
bootstrap ${RELEASE} "${ROOTFS_DIR}" http://deb.debian.org/debian/ bootstrap ${RELEASE} "${ROOTFS_DIR}" http://deb.debian.org/debian/

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
install -m 644 files/cmdline.txt "${ROOTFS_DIR}/boot/" install -m 644 files/cmdline.txt "${ROOTFS_DIR}/boot/"
install -m 644 files/config.txt "${ROOTFS_DIR}/boot/" install -m 644 files/config.txt "${ROOTFS_DIR}/boot/"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
install -d "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d" install -d "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d"
install -m 644 files/noclear.conf "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d/noclear.conf" install -m 644 files/noclear.conf "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d/noclear.conf"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
echo "${TARGET_HOSTNAME}" > "${ROOTFS_DIR}/etc/hostname" echo "${TARGET_HOSTNAME}" > "${ROOTFS_DIR}/etc/hostname"
echo "127.0.1.1 ${TARGET_HOSTNAME}" >> "${ROOTFS_DIR}/etc/hosts" echo "127.0.1.1 ${TARGET_HOSTNAME}" >> "${ROOTFS_DIR}/etc/hosts"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
if [ ! -d "${ROOTFS_DIR}" ]; then if [ ! -d "${ROOTFS_DIR}" ]; then
copy_previous copy_previous

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
install -m 755 files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/" install -m 755 files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
#install -v -d "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d" #install -v -d "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d"
#install -v -m 644 files/wait.conf "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d/" #install -v -m 644 files/wait.conf "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d/"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
echo "${TIMEZONE_DEFAULT}" > "${ROOTFS_DIR}/etc/timezone" echo "${TIMEZONE_DEFAULT}" > "${ROOTFS_DIR}/etc/timezone"
rm "${ROOTFS_DIR}/etc/localtime" rm "${ROOTFS_DIR}/etc/localtime"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
install -m 644 files/octoprint.service ${ROOTFS_DIR}/etc/systemd/system/octoprint.service install -m 644 files/octoprint.service ${ROOTFS_DIR}/etc/systemd/system/octoprint.service
mkdir -p ${ROOTFS_DIR}/home/octoprint/.octoprint/ mkdir -p ${ROOTFS_DIR}/home/octoprint/.octoprint/

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
if [ "$EUID" -ne 0 ]; then if [ "$EUID" -ne 0 ]; then
echo "This script needs to be run as root." echo "This script needs to be run as root."

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
install -m 644 files/mjpg-streamer.service ${ROOTFS_DIR}/etc/systemd/system/mjpg-streamer.service install -m 644 files/mjpg-streamer.service ${ROOTFS_DIR}/etc/systemd/system/mjpg-streamer.service
install -m 755 files/start-mjpg ${ROOTFS_DIR}/usr/local/bin/start-mjpg install -m 755 files/start-mjpg ${ROOTFS_DIR}/usr/local/bin/start-mjpg

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Include environment variables # Include environment variables
source /usr/local/etc/mjpg-server/config.sh source /usr/local/etc/mjpg-server/config.sh

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
mkdir -p "${ROOTFS_DIR}/usr/local/bin/" mkdir -p "${ROOTFS_DIR}/usr/local/bin/"
install -m 755 files/octo-config "${ROOTFS_DIR}/usr/local/bin/octo-config" install -m 755 files/octo-config "${ROOTFS_DIR}/usr/local/bin/octo-config"

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# This should never happen, no harm in checking though ;) # This should never happen, no harm in checking though ;)
if [ "$EUID" -ne 0 ]; then if [ "$EUID" -ne 0 ]; then

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
if [ ! -d "${ROOTFS_DIR}" ]; then if [ ! -d "${ROOTFS_DIR}" ]; then
copy_previous copy_previous

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
mkdir -p ${ROOTFS_DIR}/etc/default mkdir -p ${ROOTFS_DIR}/etc/default
install -m 644 files/nodm ${ROOTFS_DIR}/etc/default/nodm install -m 644 files/nodm ${ROOTFS_DIR}/etc/default/nodm

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
#rm -f "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d/wait.conf" #rm -f "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d/wait.conf"

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
mkdir -p "${ROOTFS_DIR}/home/kiosk" mkdir -p "${ROOTFS_DIR}/home/kiosk"
install -m 755 files/.xprofile "${ROOTFS_DIR}/home/kiosk/.xprofile" install -m 755 files/.xprofile "${ROOTFS_DIR}/home/kiosk/.xprofile"

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Grabs the port (and IP) out of the nginx config # Grabs the port (and IP) out of the nginx config
LISTEN=$(awk '/listen/{gsub(";",""); print $2}' /etc/nginx/listen.conf) LISTEN=$(awk '/listen/{gsub(";",""); print $2}' /etc/nginx/listen.conf)

View file

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
if [ ! -d "${ROOTFS_DIR}" ]; then if [ ! -d "${ROOTFS_DIR}" ]; then
copy_previous copy_previous