]> git.nbdom.net Git - nb.git/commitdiff
Fix compatibility with osx
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 17 Nov 2014 23:43:12 +0000 (23:43 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 17 Nov 2014 23:43:12 +0000 (23:43 +0000)
bin/nb-install

index 168f1c55703a2aecac30a5e6beff6860faeb17f7..1fc3835734fdc1e9e240be6a3c2c5274c5b8ed8c 100755 (executable)
@@ -14,16 +14,20 @@ function verbose() {
 #
 # Cron
 #
-verbose "Install /etc/cron.d/nb"
-$install "$NB_ROOT/etc/cron/nb" /etc/cron.d/nb
+if [ -d /etc/cron.d ]; then
+  verbose "Install /etc/cron.d/nb"
+  $install "$NB_ROOT/etc/cron/nb" /etc/cron.d/nb
+fi
 
 #
 # Profile
 #
-verbose "Install /etc/profile.d/nb-profile.sh"
-echo "[ -r $NB_ROOT/etc/profile.sh ] && . $NB_ROOT/etc/profile.sh" > /tmp/nb-profile.sh \
-  && $install -c /tmp/nb-profile.sh /etc/profile.d/nb-profile.sh \
-  && chmod 755 /etc/profile.d/nb-profile.sh \
-;
+if [ -d /etc/profile.d ]; then
+  verbose "Install /etc/profile.d/nb-profile.sh"
+  echo "[ -r $NB_ROOT/etc/profile.sh ] && . $NB_ROOT/etc/profile.sh" > /tmp/nb-profile.sh \
+    && $install -c /tmp/nb-profile.sh /etc/profile.d/nb-profile.sh \
+    && chmod 755 /etc/profile.d/nb-profile.sh \
+  ;
 
-rm -f /tmp/nb-profile.sh
+  rm -f /tmp/nb-profile.sh
+fi