Browse Source

make sure PAM config is only touched on initial install and final deinstall

Ralf S. Engelschall 22 years ago
parent
commit
d68fd0bcc8
1 changed files with 6 additions and 2 deletions
  1. 6 2
      openssh/openssh.spec

+ 6 - 2
openssh/openssh.spec

@@ -265,12 +265,16 @@ AutoReqProv:  no
 
     #   add PAM configuration entry
 %if "%{with_pam}" == "yes"
-    $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=openssh
+    if [ $1 -eq 1 ]; then
+        $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=openssh
+    fi
 %endif
 
 %preun
     #   remove PAM configuration entry
 %if "%{with_pam}" == "yes"
-    $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=openssh
+    if [ $1 -eq 0 ]; then
+        $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=openssh
+    fi
 %endif