diff --git a/4-public-ip.sh b/4-public-ip.sh index fe13280..708d0aa 100755 --- a/4-public-ip.sh +++ b/4-public-ip.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # there are a few different ways to resolve public-ip, # keep trying until we get a result diff --git a/6-public-ip.sh b/6-public-ip.sh index 1f0caf4..4396e98 100755 --- a/6-public-ip.sh +++ b/6-public-ip.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # there are a few different ways to resolve public-ip, # keep trying until we get a result diff --git a/all-crons.sh b/all-crons.sh index a8aff02..ab07dce 100755 --- a/all-crons.sh +++ b/all-crons.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # quickly generate a script file which will contain all crontab tasks. # optionally takes filename to use, defaults to 'crontasks.sh'. diff --git a/cloudflare.sh b/cloudflare.sh index fd2637f..5201594 100755 --- a/cloudflare.sh +++ b/cloudflare.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash quiet=false dryrun=false diff --git a/colors.sh b/colors.sh index 8381b00..3444644 100755 --- a/colors.sh +++ b/colors.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "NOTE: when using in prompt (such as PS1), color escape codes" echo "should be \\[surrounded by escaped square brackets\\]" diff --git a/config.example.sh b/config.example.sh index b3af44e..6c7a190 100644 --- a/config.example.sh +++ b/config.example.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # degrees in Celsius which we regard as too high THERMAL_ALERT=70 diff --git a/crons/backup-log.sh b/crons/backup-log.sh index 1e8c8ae..27c0a02 100755 --- a/crons/backup-log.sh +++ b/crons/backup-log.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash backupDir="$1" backupType="$2" diff --git a/crons/prune-old-backups.sh b/crons/prune-old-backups.sh index 3c1c184..fd17f06 100755 --- a/crons/prune-old-backups.sh +++ b/crons/prune-old-backups.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # prune the directory of matching files or subfolders, # until we only have the desired number of backups remaining. diff --git a/crons/storage-alert.sh b/crons/storage-alert.sh index 965ff9f..375d115 100755 --- a/crons/storage-alert.sh +++ b/crons/storage-alert.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash locations="$@" diff --git a/crons/storage-log.sh b/crons/storage-log.sh index c603c96..65520d5 100755 --- a/crons/storage-log.sh +++ b/crons/storage-log.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash locations="$@" diff --git a/crons/thermal-alert.sh b/crons/thermal-alert.sh index 39a97c6..a830547 100755 --- a/crons/thermal-alert.sh +++ b/crons/thermal-alert.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # degrees in Celsius which we regard as too high, defaults to config alertLevel="$1" diff --git a/crons/thermal-log.sh b/crons/thermal-log.sh index fd2e509..0a42ebc 100755 --- a/crons/thermal-log.sh +++ b/crons/thermal-log.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash scriptRoot="$(dirname "$0")/.." diff --git a/delay.sh b/delay.sh index 0a94963..9256e0b 100755 --- a/delay.sh +++ b/delay.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # optionally takes a single argument of how long of a delay to take. defaults to 5 seconds. seconds=$1 diff --git a/df-custom.sh b/df-custom.sh index 82c0f4e..c83a281 100755 --- a/df-custom.sh +++ b/df-custom.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash LOCATION=`dirname "$0"` diff --git a/discord.sh b/discord.sh index 1ed3cdd..182b99d 100755 --- a/discord.sh +++ b/discord.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # discord colors are standard 6-digit hex, but converted to a base-10 integer # colors taken from https://xkcd.com/color/rgb/ diff --git a/docker-hosts.sh b/docker-hosts.sh index fa37148..bddae81 100755 --- a/docker-hosts.sh +++ b/docker-hosts.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash docker ps --format='{{json .Names}}' | xargs docker inspect -f '{{range .NetworkSettings.Networks}}{{json .}}{{end}}' | jq -r '.IPAddress + " " + .Aliases[0]' diff --git a/docker-ps.sh b/docker-ps.sh index fbbe5d5..38f5a69 100755 --- a/docker-ps.sh +++ b/docker-ps.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # determine if show all or not, default to not all="" diff --git a/domain-check.sh b/domain-check.sh index c4596e4..7485fd1 100755 --- a/domain-check.sh +++ b/domain-check.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + # check https status code, for domain, and lookup ip address. # check-domain.sh www.example.com [example.org] diff --git a/dynv6.sh b/dynv6.sh index c85b5c5..57f233c 100755 --- a/dynv6.sh +++ b/dynv6.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash quiet=false while getopts 'q' flag; do diff --git a/enumerate.sh b/enumerate.sh index 7d4f5fe..7da4744 100755 --- a/enumerate.sh +++ b/enumerate.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash sort <&0 | uniq --count | sort --numeric-sort diff --git a/fetch-all.sh b/fetch-all.sh index 0ae3a4c..7ab537e 100755 --- a/fetch-all.sh +++ b/fetch-all.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # perform a "git fetch" on each location specified (recursively), or current location if none specified. # git will quietly ignore any git repo stored in a folder you lack permission on. diff --git a/golang-update.sh b/golang-update.sh index a348e46..21ef3f5 100755 --- a/golang-update.sh +++ b/golang-update.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # the command used to initialize our subtree #git subtree add --prefix golang-install https://github.com/canha/golang-tools-install-script.git master --squash diff --git a/identify-missing.sh b/identify-missing.sh index d725d17..dfd9ea2 100755 --- a/identify-missing.sh +++ b/identify-missing.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + # identify-missing.sh ./* < file_list.txt # will list all files from file/input which is not present in the given loction. diff --git a/is-restart-needed.sh b/is-restart-needed.sh index a03bf52..b5d47ae 100755 --- a/is-restart-needed.sh +++ b/is-restart-needed.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ -f "/var/run/reboot-required" ]; then echo "----- Reboot Needed ---------------------------------" diff --git a/list-all.sh b/list-all.sh index 5153518..a11728a 100755 --- a/list-all.sh +++ b/list-all.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # perform a "git remote -vv" on each location specified (recursively), or current location if none specified. # git will quietly ignore any git repo stored in a folder you lack permission on. diff --git a/named-cat.sh b/named-cat.sh index 5435c92..37a22cc 100755 --- a/named-cat.sh +++ b/named-cat.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + # cat given files prefixed with their filenames. # named-cat.sh file1.txt file2.txt diff --git a/one-time-stuff/basic-settings.sh b/one-time-stuff/basic-settings.sh index d8f95a1..18f9236 100755 --- a/one-time-stuff/basic-settings.sh +++ b/one-time-stuff/basic-settings.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + # configure basic settings, will prompt for input # setup symlinks, if not installed in users bin directory diff --git a/one-time-stuff/docker-install.sh b/one-time-stuff/docker-install.sh index dfb2ffa..ce8e78c 100755 --- a/one-time-stuff/docker-install.sh +++ b/one-time-stuff/docker-install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash read -p "Add docker to apt sources and install docker? [y/N]: " response case $response in diff --git a/one-time-stuff/install-software.sh b/one-time-stuff/install-software.sh index 4bb6a26..373b045 100755 --- a/one-time-stuff/install-software.sh +++ b/one-time-stuff/install-software.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + # install common software, will prompt before each step #echo "----- Use nginx straight from nginx.org -------------" diff --git a/one-time-stuff/privacy-setting.sh b/one-time-stuff/privacy-setting.sh index 41c8fcc..19a469c 100755 --- a/one-time-stuff/privacy-setting.sh +++ b/one-time-stuff/privacy-setting.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "----- Disable IPv6 privacy settings? in sysctl -------" read -p 'if using as a IPv6 enabled server, you probably want to turn that off? [y/N]: ' fix_tempaddr diff --git a/one-time-stuff/setup-composer.sh b/one-time-stuff/setup-composer.sh index e00f5fa..dde9579 100755 --- a/one-time-stuff/setup-composer.sh +++ b/one-time-stuff/setup-composer.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # return to where we were when we started STARTED_IN=`pwd` diff --git a/one-time-stuff/ssh-config.sh b/one-time-stuff/ssh-config.sh index cecfb68..c0cc5d0 100755 --- a/one-time-stuff/ssh-config.sh +++ b/one-time-stuff/ssh-config.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "----- Switch to secure ssh conf ---------------------" read -p 'Install the secure "sshd_config" file? [y/N]: ' secure_ssh diff --git a/one-time-stuff/ssh-port-change.sh b/one-time-stuff/ssh-port-change.sh index f61fa96..5ac8ba0 100755 --- a/one-time-stuff/ssh-port-change.sh +++ b/one-time-stuff/ssh-port-change.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo 'Enter the desired new port for ssh to use, leave blank to abort.' read -p 'change ssh to operate on a different port then normal? []: ' change_port diff --git a/one-time-stuff/system-git-enable.sh b/one-time-stuff/system-git-enable.sh index b4d21cb..95be9e4 100755 --- a/one-time-stuff/system-git-enable.sh +++ b/one-time-stuff/system-git-enable.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + # make it easy for sudo calls to have access to key scripts # setup symlinks, if not installed in users bin directory diff --git a/one-time-stuff/x-nextcloud.sh b/one-time-stuff/x-nextcloud.sh index 3614ac6..9bcd475 100755 --- a/one-time-stuff/x-nextcloud.sh +++ b/one-time-stuff/x-nextcloud.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash LOCATION=`realpath "$0"` LOCATION=`dirname "${LOCATION}"` diff --git a/public-ip.sh b/public-ip.sh index 91d3fc9..6d8e13f 100755 --- a/public-ip.sh +++ b/public-ip.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # does not always work, when you have an IPv6 connection # dig +short A myip.opendns.com @resolver1.opendns.com diff --git a/pull-all.sh b/pull-all.sh index 1a0aa09..fdeda7a 100755 --- a/pull-all.sh +++ b/pull-all.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # perform a "git pull" on each location specified (recursively), or current location if none specified. # git will quietly ignore any git repo stored in a folder you lack permission on. diff --git a/restart-if-needed.sh b/restart-if-needed.sh index f83cfee..27fee57 100755 --- a/restart-if-needed.sh +++ b/restart-if-needed.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ -f "/var/run/reboot-required" ]; then echo "----- Reboot Needed ---------------------------------" diff --git a/singleton.sh b/singleton.sh index ed52a56..0e9051f 100755 --- a/singleton.sh +++ b/singleton.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + # run the given command, but only if it's not already running. # singleton.sh long_running_script.sh --arguments --allowed diff --git a/speed-test-ttfb.sh b/speed-test-ttfb.sh index 1425a09..2e9d7cc 100755 --- a/speed-test-ttfb.sh +++ b/speed-test-ttfb.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + # speed-test-ttfb https://www.example.com/ curl -w "Connect time: %{time_connect} Time to first byte: %{time_starttransfer} Total time: %{time_total} \n" -s -o /dev/null "$@" diff --git a/status-all.sh b/status-all.sh index 780ffe7..53e08ab 100755 --- a/status-all.sh +++ b/status-all.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # perform a "git status" on each location specified (recursively), or current location if none specified. # git will quietly ignore any git repo stored in a folder you lack permission on. diff --git a/storage.sh b/storage.sh index bd80b54..fd2cef2 100755 --- a/storage.sh +++ b/storage.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash device="$1" diff --git a/thermal.sh b/thermal.sh index ef95d34..ae50f94 100755 --- a/thermal.sh +++ b/thermal.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash alertLevel="$1" diff --git a/upgrade.sh b/upgrade.sh index 7a2c5c6..a4291da 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "----- APT Update ------------------------------------" sudo apt update -y