代码拉取完成,页面将自动刷新
#!/bin/bash
#Just finished the system, no need to restore
if [ ! -d "./.system_backup" ]; then
echo "The system is the original version and does not need to be restored"
exit
fi
if [ -d /etc/X11/xorg.conf.d ]; then
sudo rm -rf /etc/X11/xorg.conf.d
fi
if [ -d ./.system_backup/xorg.conf.d ]; then
sudo cp -rf ./.system_backup/xorg.conf.d /etc/X11
if [ -f ./.system_backup/99-calibration.conf ]; then
sudo cp -rf ./.system_backup/99-calibration.conf /etc/X11/xorg.conf.d
fi
if [ -f ./.system_backup/40-libinput.conf ]; then
sudo cp -rf ./.system_backup/40-libinput.conf /etc/X11/xorg.conf.d
fi
fi
result=`grep -rn "^dtoverlay=" /boot/firmware/config.txt | grep ":rotate=" | tail -n 1`
if [ $? -eq 0 ]; then
str=`echo -n $result | awk -F: '{printf $2}' | awk -F= '{printf $NF}'`
sudo rm -rf /boot/firmware/overlays/$str-overlay.dtb
sudo rm -rf /boot/firmware/overlays/$str.dtbo
fi
ls -al ./.system_backup/*.dtb > /dev/null 2>&1 && sudo cp -rf ./.system_backup/*.dtb /boot/firmware/overlays/
ls -al ./.system_backup/*.dtbo > /dev/null 2>&1 && sudo cp -rf ./.system_backup/*.dtbo /boot/firmware/overlays/
#sudo cp -rf ./.system_backup/99-fbturbo.conf /usr/share/X11/xorg.conf.d
#sudo cp -rf ./.system_backup/cmdline.txt /boot/firmware/
sudo cp -rf ./.system_backup/config.txt /boot/firmware/
if [ -f /usr/share/X11/xorg.conf.d/99-fbturbo.conf ]; then
sudo rm -rf /usr/share/X11/xorg.conf.d/99-fbturbo.conf
fi
if [ -f ./.system_backup/99-fbturbo.conf ]; then
sudo cp -rf ./.system_backup/99-fbturbo.conf /usr/share/X11/xorg.conf.d/
fi
if [ -f /etc/rc.local ]; then
sudo rm -rf /etc/rc.local
fi
if [ -f ./.system_backup/rc.local ]; then
sudo cp -rf ./.system_backup/rc.local /etc
fi
if [ -f /etc/inittab ]; then
sudo rm -rf /etc/inittab
fi
if [ -f ./.system_backup/inittab ]; then
sudo cp -rf ./.system_backup/inittab /etc
fi
type fbcp > /dev/null 2>&1
if [ $? -eq 0 ]; then
sudo rm -rf /usr/local/bin/fbcp
fi
if [ -f ./.system_backup/have_fbcp ]; then
sudo install ./rpi-fbcp/build/fbcp /usr/local/bin/fbcp
fi
#type cmake > /dev/null 2>&1
#if [ $? -eq 0 ]; then
#sudo apt-get purge cmake -y 2> error_output.txt
#result=`cat ./error_output.txt`
#echo -e "\033[31m$result\033[0m"
#fi
#if [ -f ./.system_backup/have_cmake ]; then
#sudo apt-get install cmake -y 2> error_output.txt
#result=`cat ./error_output.txt`
#echo -e "\033[31m$result\033[0m"
#fi
if [ -f /usr/share/X11/xorg.conf.d/10-evdev.conf ]; then
sudo dpkg -P xserver-xorg-input-evdev
#sudo apt-get purge xserver-xorg-input-evdev -y 2> error_output.txt
#result=`cat ./error_output.txt`
#echo -e "\033[31m$result\033[0m"
fi
if [ -f ./.system_backup/10-evdev.conf ]; then
wget --spider -q -o /dev/null --tries=1 -T 10 https://www.x.org
if [ $? -eq 0 ]; then
sudo apt-get install xserver-xorg-input-evdev -y
else
if [ $(getconf WORD_BIT) = '32' ] && [ $(getconf LONG_BIT) = '64' ] ; then
sudo dpkg -i -B ./xserver-xorg-input-evdev_1%3a2.10.6-1_arm64.deb
else
sudo dpkg -i -B ./xserver-xorg-input-evdev_2.10.5-1_armhf.deb
fi
fi
#sudo apt-get install xserver-xorg-input-evdev -y 2> error_output.txt
#result=`cat ./error_output.txt`
#echo -e "\033[31m$result\033[0m"
fi
if [ -f /usr/share/X11/xorg.conf.d/45-evdev.conf ]; then
sudo rm -rf /usr/share/X11/xorg.conf.d/45-evdev.conf
fi
if [ -f ./.system_backup/45-evdev.conf ]; then
sudo cp -rf ./.system_backup/45-evdev.conf /usr/share/X11/xorg.conf.d
fi
if [ -f ./.have_installed ]; then
sudo rm -rf ./.have_installed
fi
if [ -f ./.system_backup/.have_installed ]; then
sudo cp -rf ./.system_backup/.have_installed ./
fi
sudo sync
sudo sync
echo "The system has been restored"
echo "now reboot"
sleep 1
sudo reboot
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。