From f9e93aa6cf6fd1f6a5d961f4774f6c54713d9824 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Le=20Ninivin?= <cedric.leninivin@tiolive.com>
Date: Fri, 31 Aug 2012 12:02:17 +0200
Subject: [PATCH] slapos-start now use /etc/opt/slapos/ as default directory

---
 slapos-node/slapos-start              | 7 +------
 slapprepare/slapprepare/script/slapos | 7 +++++--
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/slapos-node/slapos-start b/slapos-node/slapos-start
index 0de226e..2b05e0e 100755
--- a/slapos-node/slapos-start
+++ b/slapos-node/slapos-start
@@ -5,12 +5,7 @@ IPV6CHECK=ipv6.google.com
 IPV4CHECK=google.com
 IPV6WAITTIME=5
 
-# Execute slapformat
-if [ -f /etc/opt/slapos/slapos.cfg  ] ; then
-    SLAPOS_CONFIGURATION=/etc/opt/slapos
-else
-    SLAPOS_CONFIGURATION=/etc/slapos
-fi
+SLAPOS_CONFIGURATION=/etc/opt/slapos/
 
 echo "Starting slap script" 
 
diff --git a/slapprepare/slapprepare/script/slapos b/slapprepare/slapprepare/script/slapos
index b2f1a6c..b4b8c93 100755
--- a/slapprepare/slapprepare/script/slapos
+++ b/slapprepare/slapprepare/script/slapos
@@ -111,14 +111,16 @@ done
 repo=`egrep ^certificate_repository_path $SLAPOS_CONFIGURATION/slapos.cfg | sed 's/^certificate_repository_path.*= *//'`
 mkdir -v -p -m 0755 $repo
 
-# software detected, ready to run
-# Set up cron
+
 # Fix path in case of old config:
 SLAPOS_GOOD_CONFIGURATION=/etc/opt/slapos/
 if [ $SLAPOS_GOOD_CONFIGURATION != $SLAPOS_CONFIGURATION ]; then
     sed -i "s|$SLAPOS_GOOD_CONFIGURATION|$SLAPOS_CONFIGURATION|g" /etc/cron.d/slapos-node
+    sed -i "s|$SLAPOS_GOOD_CONFIGURATION|$SLAPOS_CONFIGURATION|g" /usr/sbin/slapos-start
 
 
+# Set up cron
+
 # Remove default route for ipv6 in case of openvpn-needed
 echo """# BEWARE: This file will be automatically regenerated on each boot
 SHELL=/bin/sh
@@ -148,6 +150,7 @@ sysctl -w \
   net.ipv6.neigh.default.gc_thresh2=1024 \
   net.ipv6.neigh.default.gc_thresh3=2048
 
+# software detected, ready to run
 systemctl enable slapos-node.service
 systemctl start slapos-node.service
 
-- 
2.30.9