mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-03-31 06:33:56 -04:00
🔧 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:
@@ -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() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Colors and styling
|
# Colors and styling
|
||||||
BLUE='\033[0;34m'
|
BLUE='\033[0;34m'
|
||||||
|
|||||||
@@ -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}')
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Function to install Edge Appstore
|
# Function to install Edge Appstore
|
||||||
installEdgeAppstore() {
|
installEdgeAppstore() {
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
MESSAGE="Made by BigBearTechWorld"
|
MESSAGE="Made by BigBearTechWorld"
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
# #
|
# #
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Function to ask for user confirmation
|
# Function to ask for user confirmation
|
||||||
confirm() {
|
confirm() {
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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:"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Default values
|
# Default values
|
||||||
EMAIL=""
|
EMAIL=""
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|||||||
@@ -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}}")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
MESSAGE="Made by BigBearTechWorld"
|
MESSAGE="Made by BigBearTechWorld"
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Function to ask for user confirmation
|
# Function to ask for user confirmation
|
||||||
confirm() {
|
confirm() {
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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}')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
MESSAGE="Made by BigBearTechWorld"
|
MESSAGE="Made by BigBearTechWorld"
|
||||||
|
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Log file
|
# Log file
|
||||||
LOGFILE="./casaos_reinstall.log"
|
LOGFILE="./casaos_reinstall.log"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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}')
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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 "-------------------"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Color variables
|
# Color variables
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user