Skip to content

Instantly share code, notes, and snippets.

@hukl
Created December 8, 2023 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hukl/1be32945b6b744613b449d436100f57d to your computer and use it in GitHub Desktop.
Save hukl/1be32945b6b744613b449d436100f57d to your computer and use it in GitHub Desktop.
etcupdate script
#!/bin/sh
JAIL_DIR="/usr/jails/"
# Loop through each subdirectory in JAIL_DIR
for jail_sub_dir in "$JAIL_DIR"*.lan/; do
# Check if the directory exists
if [ -d "$jail_sub_dir" ]; then
# Run etcupdate commands with the current subdirectory
echo "Updating: $jail_sub_dir"
etcupdate -D "$jail_sub_dir"
etcupdate resolve -D "$jail_sub_dir"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment