Article 6N2Z9 /etc/logrotate.d/ntp.new , New method seems a bit skewd too me .

/etc/logrotate.d/ntp.new , New method seems a bit skewd too me .

by
babydr
from LinuxQuestions.org on (#6N2Z9)
The logic operator in the new logrotate seems very odd to me .
the "!"(Not) operator is outside all logic interpretation levels thus makeing the logic of the line upto "||" as NOT if it is executable , even if it isn't due to the "||" . Sounds like Double negative to my way of thining .

Can someone run me thru the logic of this ?

Tia , JimL

Code:
# diff -u /etc/logrotate.d/ntp /etc/logrotate.d/ntp.new
--- /etc/logrotate.d/ntp 2021-02-13 03:18:21.000000000 -0900
+++ /etc/logrotate.d/ntp.new 2024-05-25 09:21:16.000000000 -0800
@@ -3,6 +3,6 @@
missingok
rotate 4
postrotate
- [ -x /etc/rc.d/rc.ntpd ] && /etc/rc.d/rc.ntpd restart
+ ! [ -x /etc/rc.d/rc.ntpd ] || /etc/rc.d/rc.ntpd restart
endscript
}
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments