Fixed %pre scriptlet. And, as a bonus, you can even understand it now. :-)
[privoxy.git] / junkbuster-rh.spec
index f6cd4c0..f6bad5a 100644 (file)
@@ -242,7 +242,15 @@ perl -pe 's/{-no-cookies}/{-no-cookies}\n\.redhat.com/' ijb.action >\
 # If we don't, we check to see if the user junkbust exist and, in case it
 # does, we change it do junkbuster. If it also does not exist, we create the
 # junkbuster user -- morcego
-id junkbuster > /dev/null 2>&1 || ( id junkbust && /usr/sbin/usermod -l junkbuster junkbust ) || ( /usr/sbin/useradd -d /etc/%{name} -r %{name} -s "" > /dev/null 2>&1 || /bin/true )
+id junkbuster > /dev/null 2>&1 
+if [ $? -eq 1 ]; then
+       id junkbust > /dev/null 2>&1 
+       if [ $? -eq 0 ]; then
+               /usr/sbin/usermod -l junkbuster -d %{_sysconfdir}/%{name} -s "" junkbust  > /dev/null 2>&1
+       else
+               /usr/sbin/useradd -d %{_sysconfdir}/%{name} -r -s "" junkbuster > /dev/null 2>&1 
+       fi
+fi
 
 %post
 # for upgrade from 2.0.x
@@ -279,7 +287,7 @@ fi
 %doc doc/text/developer-manual.txt doc/text/user-manual.txt
 %doc doc/webserver/developer-manual
 %doc doc/webserver/user-manual
-#%%doc %{name}.weekly %{name}.monthly AUTHORS
+#%doc %{name}.weekly %{name}.monthly AUTHORS
 
 %dir %{ijbconf}
 %dir %{ijbconf}/templates