summarylogtreecommitdiffstats
path: root/blackfire-agent.install
diff options
context:
space:
mode:
Diffstat (limited to 'blackfire-agent.install')
-rw-r--r--blackfire-agent.install24
1 files changed, 24 insertions, 0 deletions
diff --git a/blackfire-agent.install b/blackfire-agent.install
new file mode 100644
index 000000000000..95cb63c6e854
--- /dev/null
+++ b/blackfire-agent.install
@@ -0,0 +1,24 @@
+post_install() {
+ if [[ -z $(getent group blackfire-agent) ]]; then
+ groupadd -g 487 blackfire-agent
+ fi
+ if [[ -z $(getent passwd blackfire-agent) ]]; then
+ useradd -c 'Blackfire Agent user' -u 487 -g blackfire-agent -d / -s /usr/bin/nologin blackfire-agent
+ fi
+ passwd -l blackfire-agent > /dev/null
+
+ echo "You need to configure your Blackfire credentials via: sudo -u blackfire-agent blackfire-agent -register"
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ if [[ -n $(getent passwd blackfire-agent) ]]; then
+ userdel blackfire-agent
+ fi
+ if [[ -n $(getent group blackfire-agent) ]]; then
+ groupdel blackfire-agent
+ fi
+}