#/bin/bash
# Check if user is root
if [ $(id -u) != "0" ]; thenecho "Error: You must be root to run this script, please use root"exit 1
fi
echo ==============安装LibreOffice==========================
cd /home/
tar -zxvf LibreOffice_6.3.3_Linux_x86-64_rpm.tar.gz
cd /home/LibreOffice_6.3.3.2_Linux_x86-64_rpm/RPMS
rpm -ivh *.rpm 
mkdir -p /usr/share/xpdf
cd /home/font-xpdf 
unzip -o xpdf-chinese-simplified.zip -d /usr/share/xpdf/ 
unzip -o font.zip -d /usr/share/fonts
unzip -o win7_fonts.zip -d /opt/libreoffice6.3/share/fonts
cd /usr/share/fonts/win
mkfontscale 
mkfontdir  
fc-cache
cd /home/
rm -rf LibreOffice_6.3.3_Linux_x86-64_rpm.tar.gz LibreOffice_6.3.3.2_Linux_x86-64_rpm/  font-xpdf/ install.sh
echo "============环境安装完成========================"