Skip to content

Commit 73b819d

Browse files
Merge pull request #35 from StrangeRanger/dev
Fix clean_exit bypass and update version number
2 parents bffb501 + 4bd4795 commit 73b819d

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

hardening/UFW Cloudflare/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## v1.0.4 - 2026-05-21
8+
9+
### Fixed
10+
11+
- Replaced the use of `exit 1` with `clean_exit 1` to ensure temp files are removed on exits.
12+
713
## v1.0.3 - 2026-05-21
814

915
### Added

hardening/UFW Cloudflare/ufw-cloudflare.bash

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Set up UFW to only allow HTTP and HTTPS traffic from Cloudflare's IP ranges.
44
#
5-
# Version: v1.0.3
5+
# Version: v1.0.4
66
# License: MIT License
77
# Copyright (c) 2024-2026 Hunter T. (StrangeRanger)
88
#
@@ -88,7 +88,7 @@ clean_exit() {
8888
# shellcheck disable=SC2329,SC2317
8989
# These appear to be false positives. The function is intended to be used in the 'ERR'
9090
# trap handler, and the exit code is passed implicitly via the special variable '$?'.
91-
on_err() {
91+
on_error() {
9292
local exit_code=$?
9393

9494
echo "${C_ERROR}Command failed at line ${BASH_LINENO[0]}: ${BASH_COMMAND}" >&2
@@ -102,15 +102,15 @@ on_err() {
102102
trap 'clean_exit 129' SIGHUP
103103
trap 'clean_exit 130' SIGINT
104104
trap 'clean_exit 143' SIGTERM
105-
trap 'on_err' ERR
105+
trap 'on_error' ERR
106106

107107

108108
####[ Prepping ]############################################################################
109109

110110

111111
if (( EUID != 0 )); then
112112
echo "${C_ERROR}This script requires root privilege" >&2
113-
exit 1
113+
clean_exit 1
114114
fi
115115

116116

0 commit comments

Comments
 (0)