🔧 refactor: Use #!/usr/bin/env bash in all shell scripts (#16)

This commit refactors all the shell scripts to use `#!/usr/bin/env bash` instead of `#!/bin/bash`. This change ensures that the scripts will run with the system's default Bash interpreter, even if it is not located at the standard `/bin/bash` path.
This commit is contained in:
Christopher
2024-10-23 13:32:15 -05:00
committed by GitHub
parent 337227be4a
commit 222e6af258
61 changed files with 61 additions and 61 deletions

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Function to list volumes and allow user selection # Function to list volumes and allow user selection
select_and_remove_volumes() { select_and_remove_volumes() {

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Colors and styling # Colors and styling
BLUE='\033[0;34m' BLUE='\033[0;34m'

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Get the LAN IP address # Get the LAN IP address
lan_ip=$(hostname -I | awk '{print $1}') lan_ip=$(hostname -I | awk '{print $1}')

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Path where nextcloud directories are located # Path where nextcloud directories are located
APP_DIR="/var/lib/casaos/apps" APP_DIR="/var/lib/casaos/apps"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Function to install Edge Appstore # Function to install Edge Appstore
installEdgeAppstore() { installEdgeAppstore() {

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# URLs for the app stores # URLs for the app stores
NEW_APP_STORE_URL="https://github.com/IceWhaleTech/CasaOS-AppStore/archive/19b9149ce0bd50ffb8c898e283dc441605a3a369.zip" NEW_APP_STORE_URL="https://github.com/IceWhaleTech/CasaOS-AppStore/archive/19b9149ce0bd50ffb8c898e283dc441605a3a369.zip"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Path to the configuration file # Path to the configuration file
CONFIG_FILE="/etc/casaos/gateway.ini" CONFIG_FILE="/etc/casaos/gateway.ini"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
MESSAGE="Made by BigBearTechWorld" MESSAGE="Made by BigBearTechWorld"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Access the Docker container and run the command # Access the Docker container and run the command
key=$(docker exec big-bear-financial-freedom php artisan key:generate --show) key=$(docker exec big-bear-financial-freedom php artisan key:generate --show)

View File

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

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Ask the user for the new port number # Ask the user for the new port number
read -p "Enter the new port number for CasaOS: " new_port read -p "Enter the new port number for CasaOS: " new_port

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Function to check if jq is installed # Function to check if jq is installed
check_jq_installed() { check_jq_installed() {

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Function to ask for user confirmation # Function to ask for user confirmation
confirm() { confirm() {

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Default URL of the file to download # Default URL of the file to download
default_url="https://raw.githubusercontent.com/codex-team/codex.docs/main/docs-config.yaml" default_url="https://raw.githubusercontent.com/codex-team/codex.docs/main/docs-config.yaml"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# List all Docker volumes # List all Docker volumes
echo "Here are all the available Docker volumes:" echo "Here are all the available Docker volumes:"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# This script modifies the DNS settings and disables systemd-resolved # This script modifies the DNS settings and disables systemd-resolved

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Default values # Default values
EMAIL="" EMAIL=""

View File

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

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# List all running containers # List all running containers
containers=$(docker ps --format "{{.Names}}") containers=$(docker ps --format "{{.Names}}")

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
MESSAGE="Made by BigBearTechWorld" MESSAGE="Made by BigBearTechWorld"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Define the apps directory # Define the apps directory
APPS_DIR="/var/lib/casaos/apps" APPS_DIR="/var/lib/casaos/apps"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# This script restores the original DNS settings and re-enables systemd-resolved # This script restores the original DNS settings and re-enables systemd-resolved

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Check for root privileges # Check for root privileges
if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 0 ]]; then

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Path to the configuration file # Path to the configuration file
CONFIG_FILE="/etc/casaos/gateway.ini" CONFIG_FILE="/etc/casaos/gateway.ini"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
CONFIG_PATH="/DATA/AppData/frigate/config/config.yml" CONFIG_PATH="/DATA/AppData/frigate/config/config.yml"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Prompt the user for the file path or use the default # Prompt the user for the file path or use the default
read -p "Enter the file path to save the configuration (default: /DATA/AppData/big-bear-adguard-home/data/conf): " file_path read -p "Enter the file path to save the configuration (default: /DATA/AppData/big-bear-adguard-home/data/conf): " file_path

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Ask the user for the desired config location # Ask the user for the desired config location
read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-dashy/public/conf.yml): " location read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-dashy/public/conf.yml): " location

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e; set -e;
if [ -n "${POSTGRES_NON_ROOT_USER:-}" ] && [ -n "${POSTGRES_NON_ROOT_PASSWORD:-}" ]; then if [ -n "${POSTGRES_NON_ROOT_USER:-}" ] && [ -n "${POSTGRES_NON_ROOT_PASSWORD:-}" ]; then

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Ask the user for the desired config location # Ask the user for the desired config location
read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-n8n/db/init-data.sh): " location read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-n8n/db/init-data.sh): " location

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Ask the user for the desired config location # Ask the user for the desired config location
read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-obsidian-livesync/data/local.ini): " location read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-obsidian-livesync/data/local.ini): " location

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Ask the user for the desired config location # Ask the user for the desired config location
read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-romm/config/config.yml): " location read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-romm/config/config.yml): " location

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# This script runs a Docker command to retrieve the traccar.xml configuration file # This script runs a Docker command to retrieve the traccar.xml configuration file
# from a specified traccar Docker image tag and save it to a specified location on the host's system. # from a specified traccar Docker image tag and save it to a specified location on the host's system.

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# This script runs a Docker command to retrieve the traccar.xml configuration file # This script runs a Docker command to retrieve the traccar.xml configuration file
# from a specified traccar Docker image tag and save it to a specified location on the host's system. # from a specified traccar Docker image tag and save it to a specified location on the host's system.

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Ask the user for the desired config location # Ask the user for the desired config location
read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-unifi-network-application/db/init-mongo.js): " location read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-unifi-network-application/db/init-mongo.js): " location

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Ask the user for the desired config location # Ask the user for the desired config location
read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-unifi-network-application/db/init-mongo.js): " location read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-unifi-network-application/db/init-mongo.js): " location

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Ask the user for the desired config location # Ask the user for the desired config location
read -p "Enter the location to save the config (default: /DATA/AppData/unifi-network-application/db/init-mongo.sh): " location read -p "Enter the location to save the config (default: /DATA/AppData/unifi-network-application/db/init-mongo.sh): " location

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Ask the user for the desired config location # Ask the user for the desired config location
read -p "Enter the location to save the config (default: /DATA/AppData/unifi-network-application/db/init-mongo.js): " location read -p "Enter the location to save the config (default: /DATA/AppData/unifi-network-application/db/init-mongo.js): " location

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Function to combine container info for display # Function to combine container info for display
combine_container_info() { combine_container_info() {

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# This script attempts to find the server's primary IP address. # This script attempts to find the server's primary IP address.
# It first tries using 'ifconfig' and then falls back to 'ip addr' if 'ifconfig' doesn't produce a result. # It first tries using 'ifconfig' and then falls back to 'ip addr' if 'ifconfig' doesn't produce a result.

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Define PostgreSQL connection parameters # Define PostgreSQL connection parameters
POSTGRES_CONTAINER="immich-postgres" POSTGRES_CONTAINER="immich-postgres"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Function to ask for user confirmation # Function to ask for user confirmation
confirm() { confirm() {

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Check if Docker is installed by attempting to run the 'docker' command. # Check if Docker is installed by attempting to run the 'docker' command.
# If Docker is not found, print an error message and exit the script. # If Docker is not found, print an error message and exit the script.

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Check if the script is run as root # Check if the script is run as root
if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 0 ]]; then

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Get the IP address # Get the IP address
CURRENT_IP=$(hostname -I | awk '{print $1}') CURRENT_IP=$(hostname -I | awk '{print $1}')

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
MESSAGE="Made by BigBearTechWorld" MESSAGE="Made by BigBearTechWorld"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Function to list available USB devices with paths and names # Function to list available USB devices with paths and names
list_usb_devices() { list_usb_devices() {

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Log file # Log file
LOGFILE="./casaos_reinstall.log" LOGFILE="./casaos_reinstall.log"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# This script allows the user to reset their CasaOS username and password. # This script allows the user to reset their CasaOS username and password.
# Function to print headers # Function to print headers

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Get the IP address # Get the IP address
CURRENT_IP=$(hostname -I | awk '{print $1}') CURRENT_IP=$(hostname -I | awk '{print $1}')

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Define a message for branding purposes # Define a message for branding purposes
MESSAGE="Made by BigBearTechWorld" MESSAGE="Made by BigBearTechWorld"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Define a message for branding purposes # Define a message for branding purposes
MESSAGE="Made by BigBearTechWorld" MESSAGE="Made by BigBearTechWorld"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
LOG_FILE="pterodactyl_panel_log.txt" LOG_FILE="pterodactyl_panel_log.txt"
CONTAINER_ID="pterodactyl-panel" CONTAINER_ID="pterodactyl-panel"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# This script sends an email using the telnet command. # This script sends an email using the telnet command.
# The email details can be provided interactively or default values will be used. # The email details can be provided interactively or default values will be used.

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Display Welcome message with links and support information # Display Welcome message with links and support information
echo "-------------------" echo "-------------------"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Color variables # Color variables
GREEN='\033[0;32m' GREEN='\033[0;32m'

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Check if the script is run as root # Check if the script is run as root
if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 0 ]]; then

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Function to remove standalone Docker Compose if it exists # Function to remove standalone Docker Compose if it exists
remove_standalone_docker_compose() { remove_standalone_docker_compose() {

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Define the path to the resolv.conf file # Define the path to the resolv.conf file
resolv_conf="/etc/resolv.conf" resolv_conf="/etc/resolv.conf"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Define a message for branding purposes # Define a message for branding purposes
MESSAGE="Made by BigBearTechWorld" MESSAGE="Made by BigBearTechWorld"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
echo "---------------------" echo "---------------------"
echo "Big Bear Update Time and Timezone Script" echo "Big Bear Update Time and Timezone Script"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Define a message for branding purposes # Define a message for branding purposes
MESSAGE="Made by BigBearTechWorld" MESSAGE="Made by BigBearTechWorld"