add nfs bootstrap
This commit is contained in:
parent
9c3015efc0
commit
e2b8206e86
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
function create_dir() {
|
||||||
|
echo "creating directory: $1"
|
||||||
|
mkdir -p $1
|
||||||
|
}
|
||||||
|
|
||||||
|
function check_dir() {
|
||||||
|
[[ ! -d "$1" ]] && create_dir $1
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_nfs_mnt() {
|
||||||
|
echo "making sure mount point exists..."
|
||||||
|
check_dir '/var/lib/docker/volumes'
|
||||||
|
|
||||||
|
echo "installing nfs mount."
|
||||||
|
echo '10.200.99.231:/volume1/docker/volumes /var/lib/docker/volumes nfs auto,_netdev,x-systemd.automount 0 0' >> /etc/fstab
|
||||||
|
systemctl daemon-reload
|
||||||
|
}
|
||||||
|
|
||||||
|
grep '/var/lib/docker/volumes' >/dev/null || install_nfs_mnt
|
Loading…
Reference in New Issue