summaryrefslogtreecommitdiff
path: root/community/oprofile/oprofile.install
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-01-28 00:05:59 -0800
committerroot <root@rshg054.dnsready.net>2013-01-28 00:05:59 -0800
commit1b9f6dc846379470b620b5dbb9d4d7acd1de148c (patch)
tree2305b950a3c94970b05c1a38af473f5cca95af02 /community/oprofile/oprofile.install
parentb9b96ada56ad38df20b1e528a095a1e86ab67a2b (diff)
Mon Jan 28 00:05:59 PST 2013
Diffstat (limited to 'community/oprofile/oprofile.install')
-rw-r--r--community/oprofile/oprofile.install21
1 files changed, 21 insertions, 0 deletions
diff --git a/community/oprofile/oprofile.install b/community/oprofile/oprofile.install
new file mode 100644
index 000000000..5cd3e7e22
--- /dev/null
+++ b/community/oprofile/oprofile.install
@@ -0,0 +1,21 @@
+post_install(){
+ groupadd -g 492 oprofile &>/dev/null
+ useradd -u 492 -g oprofile -d /var/lib/oprofile -s /bin/false oprofile &>/dev/null
+}
+
+post_upgrade(){
+ getent group oprofile >/dev/null 2>&1 || groupadd -g 492 oprofile &>/dev/null
+ getent passwd oprofile >/dev/null 2>&1 || useradd -u 492 -g oprofile -d /var/lib/oprofile -s /bin/false oprofile &>/dev/null
+ if [ "$(vercmp $2 0.9.7-2)" -lt 0 ] ; then
+ usermod -d /var/lib/oprofile oprofile
+ fi
+}
+
+post_remove(){
+ if getent passwd oprofile >/dev/null 2>&1; then
+ userdel oprofile
+ fi
+ if getent group oprofile >/dev/null 2>&1; then
+ groupdel oprofile
+ fi
+}