Commit e5e51ed7 authored by Joanne Hugé's avatar Joanne Hugé

playbook/util: make scripts work from any path

parent 87dad3af
...@@ -13,7 +13,7 @@ function cleanup { ...@@ -13,7 +13,7 @@ function cleanup {
} }
trap cleanup EXIT trap cleanup EXIT
HERE=`pwd` HERE=`dirname $(realpath $0)`/..
DFILE=`mktemp -d` DFILE=`mktemp -d`
TFILE="archive.tar.gz" TFILE="archive.tar.gz"
cd $DFILE cd $DFILE
......
cd $(dirname $(realpath $0))/..
sed -i "s/upgrade_after:.*/upgrade_after: `date +%s`/g" settings/upgrader.yml sed -i "s/upgrade_after:.*/upgrade_after: `date +%s`/g" settings/upgrader.yml
playbook_dir="$(dirname $(realpath $0))/.."
conf=${1:-/etc/opt/slapcache.cfg} conf=${1:-/etc/opt/slapcache.cfg}
conf=$(realpath $conf) conf=$(realpath $conf)
cd $playbook_dir
rm -f /tmp/archive.tar.gz && tar -czvf /tmp/archive.tar.gz . && slapcache-upload --file=/tmp/archive.tar.gz --slapos-configuration=$conf rm -f /tmp/archive.tar.gz && tar -czvf /tmp/archive.tar.gz . && slapcache-upload --file=/tmp/archive.tar.gz --slapos-configuration=$conf
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment