Changed shebangs to be portable
I did this because hardcoding /bin/bash is generally not good practice
This commit is contained in:
parent
3f556a1147
commit
d224b02031
31 changed files with 58 additions and 31 deletions
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -eu
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
BUILD_OPTS="$*"
|
||||
|
|
3
build.sh
3
build.sh
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
# shellcheck disable=SC2119
|
||||
run_sub_stage()
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if [ ! -x "${ROOTFS_DIR}/usr/bin/qemu-arm-static" ]; then
|
||||
cp /usr/bin/qemu-arm-static "${ROOTFS_DIR}/usr/bin/"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
on_chroot << EOF
|
||||
apt-get update
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
install -m 644 files/resolv.conf "${ROOTFS_DIR}/etc/"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
||||
INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.info"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}"
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
||||
NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}"
|
||||
|
|
|
@ -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/raspi.list "${ROOTFS_DIR}/etc/apt/sources.list.d/"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if [ ! -d "${ROOTFS_DIR}" ]; then
|
||||
bootstrap ${RELEASE} "${ROOTFS_DIR}" http://deb.debian.org/debian/
|
||||
|
|
|
@ -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/config.txt "${ROOTFS_DIR}/boot/"
|
||||
|
|
|
@ -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 -m 644 files/noclear.conf "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d/noclear.conf"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
echo "${TARGET_HOSTNAME}" > "${ROOTFS_DIR}/etc/hostname"
|
||||
echo "127.0.1.1 ${TARGET_HOSTNAME}" >> "${ROOTFS_DIR}/etc/hosts"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if [ ! -d "${ROOTFS_DIR}" ]; then
|
||||
copy_previous
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
install -m 755 files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/"
|
||||
|
||||
|
|
|
@ -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 -m 644 files/wait.conf "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d/"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
echo "${TIMEZONE_DEFAULT}" > "${ROOTFS_DIR}/etc/timezone"
|
||||
rm "${ROOTFS_DIR}/etc/localtime"
|
||||
|
|
|
@ -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
|
||||
mkdir -p ${ROOTFS_DIR}/home/octoprint/.octoprint/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "This script needs to be run as root."
|
||||
|
|
|
@ -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 755 files/start-mjpg ${ROOTFS_DIR}/usr/local/bin/start-mjpg
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Include environment variables
|
||||
source /usr/local/etc/mjpg-server/config.sh
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
mkdir -p "${ROOTFS_DIR}/usr/local/bin/"
|
||||
install -m 755 files/octo-config "${ROOTFS_DIR}/usr/local/bin/octo-config"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This should never happen, no harm in checking though ;)
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if [ ! -d "${ROOTFS_DIR}" ]; then
|
||||
copy_previous
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
mkdir -p ${ROOTFS_DIR}/etc/default
|
||||
install -m 644 files/nodm ${ROOTFS_DIR}/etc/default/nodm
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
mkdir -p "${ROOTFS_DIR}/home/kiosk"
|
||||
install -m 755 files/.xprofile "${ROOTFS_DIR}/home/kiosk/.xprofile"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Grabs the port (and IP) out of the nginx config
|
||||
LISTEN=$(awk '/listen/{gsub(";",""); print $2}' /etc/nginx/listen.conf)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if [ ! -d "${ROOTFS_DIR}" ]; then
|
||||
copy_previous
|
||||
|
|
Loading…
Reference in a new issue