Jose Henrique d78c4946bd
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 38s
Combine update.sh + clean.sh into housekeeping.sh with subcommand dispatch
- Merges both scripts into a single unified housekeeping.sh
- Subcommands: update, clean, omz, all (default)
- New 'omz' command: runs 'omz update' with safe fallback if not installed
- Unknown subcommands print usage and exit 0
- Shared utility functions defined once at top
- Preserves all existing OS detection, cleanup, and reporting logic
2026-07-05 13:09:20 -03:00
2025-10-06 22:14:42 -03:00
2026-05-16 11:29:32 -03:00
2025-08-17 12:40:37 -03:00

server-scripts

Useful scripts for managing servers written in Bash. Supported OS includes Debian/Ubuntu, Alpine, Arch, RHEL/Fedora/CentOS, openSUSE, Void, and Gentoo.

In the past I was using it more for maintaining my home servers, bare metal with Docker, however when I changed to k3s, I started using it less. Now I'm using this as a collection of useful scripts that I can use when needed. Also clean.sh is still useful.

clean.sh

This script is used to clean some of the files, docker dangling images, and docker stopped/unused containers.

update.sh

Detects the running OS (Alpine, Arch, Debian/Ubuntu, RHEL/Fedora/CentOS, openSUSE, Void, Gentoo) and updates the package list only — it does not upgrade or install any packages. Useful for keeping package indexes fresh so that upgrade commands run faster later.

Run with curl | bash:

curl -sSL https://git.ivanch.me/ivanch/server-scripts/raw/branch/main/update.sh | bash

windows-backup.ps1

This PowerShell script is used to backup files from a Windows machine to a remote Samba server. It uses 7zip to create the zip file, and then sends over the network using SMB protocol.

dns-override.sh

Aggressive, best-effort DNS override script for Linux hosts with support for multiple resolver stacks (systemd-resolved, NetworkManager, resolvconf/openresolv, dhclient, systemd-networkd, and ifupdown) plus direct /etc/resolv.conf writes.

It prompts for:

  • 2 required DNS servers
  • 1 optional third DNS server

Validation/features:

  • Accepts IPv4 and IPv6 literals
  • Rejects invalid or duplicate entries
  • Performs reachability checks (warn-only, does not block execution)
  • Can optionally lock /etc/resolv.conf with chattr +i

Run with curl | bash:

curl -sSL https://git.ivanch.me/ivanch/server-scripts/raw/branch/main/dns-override.sh | bash

Important notes:

  • Requires interactive TTY input (prompts are read from /dev/tty)
  • Requires root privileges (sudo is used/re-execed when possible)
  • Script is intentionally aggressive and may restart/reload network services
  • On heavily managed systems (custom agents, immutable images, enterprise policy), behavior is still best-effort

Haven Notify

It's a small internal service designed to send notifications to a specified Discord channel via webhooks. It's written in Go and can be easily deployed.

The project is defined on /haven-notify folder.

Description
No description provided
Readme 1 MiB
Languages
Shell 86.9%
Go 8.7%
PowerShell 3.7%
Dockerfile 0.7%