fix shell hinting

This commit is contained in:
Sebastian Cabrera 2026-05-14 15:48:35 -04:00
parent c9ec93d456
commit 77cb1f013a
Signed by: okseby
GPG key ID: 2DDBFDEE356CF3DE
6 changed files with 41 additions and 14 deletions

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
PASSWD_FILE="/etc/squid/passwd" PASSWD_FILE="/etc/squid/passwd"

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env bash
# Function to check dock size # Function to check dock size
check_dock() { check_dock() {

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Default values # Default values
VERBOSE=false VERBOSE=false
@ -61,42 +61,42 @@ moved_count=0
# Function to process files # Function to process files
process_files() { process_files() {
local find_cmd="find \"$SOURCE_DIR\" -maxdepth 1 -type f -iname \"*$SEARCH_WORD*\"" local find_cmd="find \"$SOURCE_DIR\" -maxdepth 1 -type f -iname \"*$SEARCH_WORD*\""
# Exclude .part files and macOS resource fork files by default # Exclude .part files and macOS resource fork files by default
if [ "$INCLUDE_PART" = false ]; then if [ "$INCLUDE_PART" = false ]; then
find_cmd="$find_cmd -not -name \"*.part\"" find_cmd="$find_cmd -not -name \"*.part\""
fi fi
find_cmd="$find_cmd -not -name \"._*\"" find_cmd="$find_cmd -not -name \"._*\""
# First, show what would be moved # First, show what would be moved
echo "The following files would be moved:" echo "The following files would be moved:"
eval "$find_cmd" eval "$find_cmd"
# Count files that would be moved # Count files that would be moved
local file_count=$(eval "$find_cmd" | wc -l) local file_count=$(eval "$find_cmd" | wc -l)
if [ "$file_count" -eq 0 ]; then if [ "$file_count" -eq 0 ]; then
echo "No matching files found." echo "No matching files found."
exit 0 exit 0
fi fi
# Show what actions will be taken # Show what actions will be taken
echo echo
if [ ! -d "$DEST_DIR" ]; then if [ ! -d "$DEST_DIR" ]; then
echo "The destination directory '$DEST_DIR' will be created." echo "The destination directory '$DEST_DIR' will be created."
fi fi
echo "Files will be moved to: '$DEST_DIR'" echo "Files will be moved to: '$DEST_DIR'"
# Prompt for confirmation # Prompt for confirmation
echo -n "Do you want to proceed? (y/n): " echo -n "Do you want to proceed? (y/n): "
read -r response read -r response
if [[ "$response" =~ ^[Yy]$ ]]; then if [[ "$response" =~ ^[Yy]$ ]]; then
# Create destination directory if needed # Create destination directory if needed
if [ ! -d "$DEST_DIR" ]; then if [ ! -d "$DEST_DIR" ]; then
mkdir -p "$DEST_DIR" mkdir -p "$DEST_DIR"
fi fi
while IFS= read -r file; do while IFS= read -r file; do
if [ "$VERBOSE" = true ]; then if [ "$VERBOSE" = true ]; then
echo "Moving: $file" echo "Moving: $file"
@ -107,7 +107,7 @@ process_files() {
echo "Error: Failed to move '$file'" >&2 echo "Error: Failed to move '$file'" >&2
fi fi
done < <(eval "$find_cmd") done < <(eval "$find_cmd")
echo "Operation completed. $moved_count file(s) moved to '$DEST_DIR'" echo "Operation completed. $moved_count file(s) moved to '$DEST_DIR'"
else else
echo "Operation cancelled." echo "Operation cancelled."

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Set timezone to US Eastern (handles both EST and EDT correctly) # Set timezone to US Eastern (handles both EST and EDT correctly)
export TZ="America/New_York" export TZ="America/New_York"

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Check if the Metal HUD is currently enabled # Check if the Metal HUD is currently enabled
MTL_STATUS=$(/bin/launchctl getenv MTL_HUD_ENABLED 2>/dev/null) MTL_STATUS=$(/bin/launchctl getenv MTL_HUD_ENABLED 2>/dev/null)

27
scripts/update-forgejo.sh Normal file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "Usage: $0 <version>"
echo "Example: $0 11.0.10"
exit 1
fi
VERSION="$1"
case "$(uname -m)" in
x86_64) ARCH="amd64" ;;
aarch64) ARCH="arm64" ;;
armv7l) ARCH="arm-6" ;;
*)
echo "Unsupported architecture: $(uname -m)"
exit 1
;;
esac
BINARY="forgejo-${VERSION}-linux-${ARCH}"
wget "https://codeberg.org/forgejo/forgejo/releases/download/v${VERSION}/${BINARY}"
chmod +x "$BINARY"
systemctl stop forgejo
cp "$BINARY" /usr/local/bin/forgejo
systemctl start forgejo