#!/bin/bash

sde2=$(df |grep sde2|awk '{print $1}')

if [ ! ${sde2} ];then
   echo "sde error"
   exit
else
   echo "sde success"

fi

work=/opt/collect/20-eth0.network
work1=/opt/collect/21-eth1.network
#ls -l /opt/collect/20-eth0.network >/dev/null 2>&1

#if [ $? -eq 0 ];then
if [  -f ${work} ];then
   echo "fileexist success"
elif [ -L "/etc/systemd/network/20-eth0.network" ];then
   echo "profile error"
   exit
else
   cp /etc/systemd/network/20-eth0.network /opt/collect/20-eth0.network
   echo "profile success"
fi


#ls -l /opt/collect/21-eth1.network >/dev/null 2>&1

#if [ $? -eq 0 ];then
if [ -f ${work1} ];then
   echo "fileexist success"
elif [ -L "/etc/systemd/network/20-eth0.network" ];then
   echo "profile error"
   exit
else
   cp /etc/systemd/network/21-eth1.network /opt/collect/21-eth1.network
   echo "profile success"
fi

#sde2=$(df |grep sde2|awk '{print $1}')
#
#if [ ! ${sde2} ];then
#   echo "no"
#else
#   echo "ok"
#
#fi
#
#
#ls -l /opt/collect/20-eth0.network >/dev/null 2>&1
#
#if [ $? -eq 0 ];then
#   echo "文件已存在"
#else
#   cp /etc/systemd/network/20-eth0.network /opt/collect/20-eth0.network
#   echo "OK" 
#fi
#
#
#ls -l /opt/collect/21-eth1.network >/dev/null 2>&1
#
#if [ $? -eq 0 ];then
#   echo "文件已存在"
#else
#   cp /etc/systemd/network/21-eth1.network /opt/collect/21-eth1.network
#   echo "OK"
#fi

