Browse Source

Copy Nginx Configuration Files If Source And Destination Files MD5SUM Is Different

old-stable
Mitesh Shah 12 years ago
parent
commit
6037e04c5e
  1. 37
      usr/local/sbin/easyengine

37
usr/local/sbin/easyengine

@ -82,6 +82,33 @@ INSTALLNGINX()
sudo $EEAPTGET install nginx-custom || OwnError "Unable To Install Nginx" sudo $EEAPTGET install nginx-custom || OwnError "Unable To Install Nginx"
} }
EEMD5SUM()
{
SOURCE=$EESOURCE
DEST=$EEDEST
for i in $SOURCE/*
do
# Get File Name
EEFILE=$(basename $i)
SOURCEMD5SUM=$(md5sum $SOURCE/$EEFILE | cut -d' ' -f1)
DESTMD5SUM=$(md5sum $DEST/$EEFILE 2> /dev/null | cut -d' ' -f1)
# Check If Destination File Exist
if [ -z "$DESTMD5SUM" ]
then
# Copy Missing Destination Files
cp -avi $SOURCE/$EEFILE $DEST/$EEFILE
elif [ "$SOURCEMD5SUM" != "$DESTMD5SUM" ]
then
# Update Destination On MD5SUM Not Matched
cp -vi $SOURCE/$EEFILE $DEST/$EEFILE
fi
done
}
COMMONNGINX() COMMONNGINX()
{ {
# Personal Settings For Nginx # Personal Settings For Nginx
@ -99,12 +126,14 @@ COMMONNGINX()
fi fi
# Update Nginx Configuration Files # Update Nginx Configuration Files
rsync -ac /usr/share/easyengine/nginx/conf.d/* /etc/nginx/conf.d/ \ EESOURCE="/usr/share/easyengine/nginx/conf.d"
|| OwnError "Unable To Copy Nginx Configuration Files" EEDEST="/etc/nginx/conf.d"
EEMD5SUM
# Update Nginx Common Files # Update Nginx Common Files
rsync -ac /usr/share/easyengine/nginx/common/* /etc/nginx/common/ \ EESOURCE="/usr/share/easyengine/nginx/common"
|| OwnError "Unable To Copy Nginx Common Files" EEDEST="/etc/nginx/common"
EEMD5SUM
} }
INSTALLPHP() INSTALLPHP()

Loading…
Cancel
Save