Compare commits
11 Commits
tweak/32bi
...
3eacdc8872
| Author | SHA1 | Date | |
|---|---|---|---|
| 3eacdc8872 | |||
| 87cb43cc85 | |||
| 0a903feb12 | |||
| 15874b002e | |||
| ca9de23ca5 | |||
| d807c40ba5 | |||
|
|
4125bcccdc | ||
|
|
ac37014628 | ||
|
|
d765ce768f | ||
|
|
7df117876f | ||
|
|
1a3a23a867 |
@@ -50,9 +50,10 @@ rm -f "/etc/pihole/GitHubVersions"
|
||||
rm -f "/etc/pihole/localbranches"
|
||||
rm -f "/etc/pihole/localversions"
|
||||
|
||||
# Create new versions file if it does not exist
|
||||
VERSION_FILE="/etc/pihole/versions"
|
||||
touch "${VERSION_FILE}"
|
||||
|
||||
# Truncates the file to zero length if it exists to clear it up, otherwise creates an empty file.
|
||||
truncate -s 0 "${VERSION_FILE}"
|
||||
chmod 644 "${VERSION_FILE}"
|
||||
|
||||
# if /pihole.docker.tag file exists, we will use it's value later in this script
|
||||
|
||||
@@ -30,9 +30,6 @@ addOrEditKeyValPair() {
|
||||
local key="${2}"
|
||||
local value="${3}"
|
||||
|
||||
# touch file to prevent grep error if file does not exist yet
|
||||
touch "${file}"
|
||||
|
||||
if grep -q "^${key}=" "${file}"; then
|
||||
# Key already exists in file, modify the value
|
||||
sed -i "/^${key}=/c\\${key}=${value}" "${file}"
|
||||
|
||||
@@ -57,9 +57,9 @@ start() {
|
||||
stop() {
|
||||
if is_running; then
|
||||
kill "${FTL_PID}"
|
||||
# Give FTL 60 seconds to gracefully stop
|
||||
# Give FTL 120 seconds to gracefully stop
|
||||
i=1
|
||||
while [ "${i}" -le 60 ]; do
|
||||
while [ "${i}" -le 120 ]; do
|
||||
if ! is_running; then
|
||||
break
|
||||
fi
|
||||
|
||||
@@ -28,7 +28,7 @@ ExecReload=/bin/kill -HUP $MAINPID
|
||||
ExecStopPost=+/opt/pihole/pihole-FTL-poststop.sh
|
||||
|
||||
# Use graceful shutdown with a reasonable timeout
|
||||
TimeoutStopSec=60s
|
||||
TimeoutStopSec=120s
|
||||
|
||||
# Make /usr, /boot, /etc and possibly some more folders read-only...
|
||||
ProtectSystem=full
|
||||
|
||||
@@ -165,6 +165,8 @@ PIHOLE_META_DEPS_APK=(
|
||||
cronie
|
||||
curl
|
||||
dialog
|
||||
doas # sudo replacement
|
||||
doas-sudo-shim
|
||||
git
|
||||
grep
|
||||
iproute2-minimal # piholeARPTable.sh
|
||||
@@ -178,7 +180,6 @@ PIHOLE_META_DEPS_APK=(
|
||||
procps-ng
|
||||
psmisc
|
||||
shadow
|
||||
sudo
|
||||
tzdata
|
||||
unzip
|
||||
)
|
||||
|
||||
@@ -2,6 +2,7 @@ def test_key_val_replacement_works(host):
|
||||
"""Confirms addOrEditKeyValPair either adds or replaces a key value pair in a given file"""
|
||||
host.run("""
|
||||
source /opt/pihole/utils.sh
|
||||
touch ./testoutput
|
||||
addOrEditKeyValPair "./testoutput" "KEY_ONE" "value1"
|
||||
addOrEditKeyValPair "./testoutput" "KEY_TWO" "value2"
|
||||
addOrEditKeyValPair "./testoutput" "KEY_ONE" "value3"
|
||||
|
||||
Reference in New Issue
Block a user