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
|
||||
select_and_remove_volumes() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Colors and styling
|
||||
BLUE='\033[0;34m'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Get the LAN IP address
|
||||
lan_ip=$(hostname -I | awk '{print $1}')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Path where nextcloud directories are located
|
||||
APP_DIR="/var/lib/casaos/apps"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Function to install Edge Appstore
|
||||
installEdgeAppstore() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# URLs for the app stores
|
||||
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
|
||||
CONFIG_FILE="/etc/casaos/gateway.ini"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
MESSAGE="Made by BigBearTechWorld"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Access the Docker container and run the command
|
||||
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
|
||||
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
|
||||
check_jq_installed() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Function to ask for user confirmation
|
||||
confirm() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Default URL of the file to download
|
||||
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
|
||||
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
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Default values
|
||||
EMAIL=""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# List all running containers
|
||||
containers=$(docker ps --format "{{.Names}}")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
MESSAGE="Made by BigBearTechWorld"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Define the apps directory
|
||||
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
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Check for root privileges
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Path to the configuration file
|
||||
CONFIG_FILE="/etc/casaos/gateway.ini"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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
|
||||
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
|
||||
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;
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
# 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
|
||||
# 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
combine_container_info() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 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.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Define PostgreSQL connection parameters
|
||||
POSTGRES_CONTAINER="immich-postgres"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Function to ask for user confirmation
|
||||
confirm() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 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.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Check if the script is run as root
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Get the IP address
|
||||
CURRENT_IP=$(hostname -I | awk '{print $1}')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
MESSAGE="Made by BigBearTechWorld"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Function to list available USB devices with paths and names
|
||||
list_usb_devices() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Log file
|
||||
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.
|
||||
|
||||
# Function to print headers
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Get the IP address
|
||||
CURRENT_IP=$(hostname -I | awk '{print $1}')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Define a message for branding purposes
|
||||
MESSAGE="Made by BigBearTechWorld"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Define a message for branding purposes
|
||||
MESSAGE="Made by BigBearTechWorld"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
LOG_FILE="pterodactyl_panel_log.txt"
|
||||
CONTAINER_ID="pterodactyl-panel"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script sends an email using the telnet command.
|
||||
# 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
|
||||
echo "-------------------"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Color variables
|
||||
GREEN='\033[0;32m'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Check if the script is run as root
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Function to remove standalone Docker Compose if it exists
|
||||
remove_standalone_docker_compose() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Define the path to the resolv.conf file
|
||||
resolv_conf="/etc/resolv.conf"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Define a message for branding purposes
|
||||
MESSAGE="Made by BigBearTechWorld"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "---------------------"
|
||||
echo "Big Bear Update Time and Timezone Script"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Define a message for branding purposes
|
||||
MESSAGE="Made by BigBearTechWorld"
|
||||
|
||||
Reference in New Issue
Block a user