]> git.nbdom.net Git - nb.git/commitdiff
function fdiff
authorroot <root@big.cascais.loc>
Wed, 19 Nov 2014 15:37:27 +0000 (15:37 +0000)
committerroot <root@big.cascais.loc>
Wed, 19 Nov 2014 15:37:27 +0000 (15:37 +0000)
bin/nb-install

index e528246408256f0d8f23773c82329649049369a2..46bc25f884d52b0d700b24b92b1603d4e25c68fb 100755 (executable)
@@ -28,7 +28,9 @@ function crond2tab() {
 }
 
 function fdiff() {
-  [ -n "$(diff -q $1 $2)" ] && return 0
+  [ -e "$1" ] || return 0
+  [ -e "$2" ] || return 0
+  [ -n "$(diff -q $1 $2 2>/dev/null)" ] && return 0
   return 1
 }
 
@@ -36,6 +38,7 @@ function fdiff() {
 # Cron
 #
 if [ -d /etc/cron.d ]; then
+
   if fdiff "$NB_ROOT/etc/cron/nb" "/etc/cron.d/nb"; then
     verbose "Install /etc/cron.d/nb"
     $install "$NB_ROOT/etc/cron/nb" /etc/cron.d/nb