mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-14 16:43:37 +02:00
Move config files and folders
This commit is contained in:
parent
2c1989beb0
commit
fa9d6444f5
18 changed files with 70 additions and 52 deletions
|
@ -13,7 +13,7 @@ if [ "$1" = "configure" ] && [ -d /run/systemd/system ]; then
|
|||
chmod 700 /var/cache/ntfy
|
||||
|
||||
# Hack to change permissions on cache file
|
||||
configfile="/etc/ntfy/config.yml"
|
||||
configfile="/etc/ntfy/server.yml"
|
||||
if [ -f "$configfile" ]; then
|
||||
cachefile="$(cat "$configfile" | perl -n -e'/^\s*cache-file: ["'"'"']?([^"'"'"']+)["'"'"']?/ && print $1')" # Oh my, see #47
|
||||
if [ -n "$cachefile" ]; then
|
||||
|
|
|
@ -4,7 +4,7 @@ set -e
|
|||
# Delete the config if package is purged
|
||||
if [ "$1" = "purge" ]; then
|
||||
id ntfy >/dev/null 2>&1 && userdel ntfy
|
||||
rm -f /etc/ntfy/config.yml
|
||||
rm -f /etc/ntfy/server.yml
|
||||
rmdir /etc/ntfy || true
|
||||
fi
|
||||
|
||||
|
|
11
scripts/preinst.sh
Executable file
11
scripts/preinst.sh
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
|
||||
# Migration of old to new config file name
|
||||
oldconfigfile="/etc/ntfy/config.yml"
|
||||
configfile="/etc/ntfy/server.yml"
|
||||
if [ -f "$oldconfigfile" ] && [ ! -f "$configfile" ]; then
|
||||
mv "$oldconfigfile" "$configfile" || true
|
||||
fi
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue