Add default service config
This commit is contained in:
parent
227e11be02
commit
1ef1e09b8d
8 changed files with 198 additions and 19 deletions
|
|
@ -2,8 +2,19 @@
|
|||
|
||||
set -e
|
||||
|
||||
# Create rpxy user if it doesn't exist
|
||||
if ! id rpxy >/dev/null 2>&1; then
|
||||
useradd --system --no-create-home --shell /usr/sbin/nologin rpxy
|
||||
fi
|
||||
|
||||
# Set correct user for config directory
|
||||
if [ -d /etc/rpxy ]; then
|
||||
chown -R rpxy:rpxy /etc/rpxy
|
||||
fi
|
||||
|
||||
# Reload systemd, enable and start the service
|
||||
systemctl daemon-reload
|
||||
systemctl enable rpxy
|
||||
systemctl start rpxy
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
|
|
|
|||
17
.build/DEB/postrm
Normal file
17
.build/DEB/postrm
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Remove the rpxy user and configuration directory only if purging the package
|
||||
if [ "$1" = "purge" ]; then
|
||||
if id rpxy >/dev/null 2>&1; then
|
||||
userdel rpxy
|
||||
fi
|
||||
|
||||
# Remove config directory
|
||||
if [ -d /etc/rpxy ]; then
|
||||
rm -rf /etc/rpxy
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
set -e
|
||||
|
||||
# Stop and disable the service before removing
|
||||
systemctl stop rpxy || true
|
||||
systemctl disable rpxy || true
|
||||
systemctl daemon-reload
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue