Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (33 sloc) 1.29 KB
# Foreman-proxy: Installer: Arch
# Maintainer: Greg Sutcliffe <greg.sutcliffe@gmail.com>>
pre_install() {
# Add the "foreman-proxy" user and group
getent group foreman-proxy &>/dev/null || groupadd -r foreman-proxy &>/dev/null
getent passwd foreman-proxy &>/dev/null || useradd -r -g foreman-proxy -d /usr/share/foreman-proxy -s /sbin/nologin -c "Foreman Proxy deamon user" foreman-proxy &>/dev/null || :
}
post_install() {
chown -R foreman-proxy:foreman-proxy /usr/share/foreman-proxy
chown -R foreman-proxy:foreman-proxy /var/log/foreman-proxy
/usr/bin/systemd-tmpfiles --create foreman-proxy.conf
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
}
pre_upgrade() {
pre_install
usermod -d /usr/share/foreman-proxy foreman-proxy &>/dev/null || :
}
post_upgrade() {
chown -R foreman-proxy:foreman-proxy /usr/share/foreman-proxy
chown -R foreman-proxy:foreman-proxy /var/log/foreman-proxy
}
pre_remove() {
# Cleanup tmpfiles
rm -rf /usr/share/foreman-proxy/tmp
/usr/bin/systemctl --no-reload disable foreman-proxy.service >/dev/null 2>&1 || :
/usr/bin/systemctl stop foreman-proxy.service >/dev/null 2>&1 || :
}
post_remove() {
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
# Remove user and group
groupdel foreman-proxy >/dev/null 2>&1
userdel foreman-proxy
}
Something went wrong with that request. Please try again.