docker-onlyoffice-stack/start.sh

22 lines
923 B
Bash
Raw Normal View History

2020-02-26 16:40:13 +00:00
#!/bin/bash
source ~/openrc.sh
INSTANCE=$(/home/yohan/env_py3/bin/openstack server show -c id --format value $(hostname))
sudo mkdir -p /mnt/volumes/onlyoffice_data
2020-02-26 16:40:13 +00:00
if ! mountpoint -q /mnt/volumes/onlyoffice_data
then
VOLUME_ID=$(/home/yohan/env_py3/bin/openstack volume show onlyoffice_data -c id --format value)
test -e /dev/disk/by-id/*${VOLUME_ID:0:20} || nova volume-attach $INSTANCE $VOLUME_ID auto
sleep 3
sudo mount /dev/disk/by-id/*${VOLUME_ID:0:20} /mnt/volumes/onlyoffice_data
fi
sudo mkdir -p /mnt/volumes/onlyoffice_log
2020-02-26 16:40:13 +00:00
if ! mountpoint -q /mnt/volumes/onlyoffice_log
then
VOLUME_ID=$(/home/yohan/env_py3/bin/openstack volume show onlyoffice_log -c id --format value)
test -e /dev/disk/by-id/*${VOLUME_ID:0:20} || nova volume-attach $INSTANCE $VOLUME_ID auto
sleep 3
sudo mount /dev/disk/by-id/*${VOLUME_ID:0:20} /mnt/volumes/onlyoffice_log
fi
sudo docker-compose up -d