#!/bin/sh

VD=$(grep -w "/dev/vd[b-z].*" /etc/fstab)
SD=$(grep -w "/dev/sd.*" /etc/fstab)
AZ=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)

if [ -n "$VD" ] || [ -n "$SD" ]; then
	echo -e "\nOUTSCALE WARNING! Wrong volumes names in your /etc/fstab: \n\n$SD \n$VD\n"
	echo -e "Please contact the Outscale support with the following informations: \n"
	echo -e "--ID: $ID\n--AZ: $AZ\n--FSTAB:\n$SD\n$VD\n"
fi
