纯粹就是为了偷懒,没啥可介绍的。
尝试与能显示命令执行进度的progress
进行联动,但是失败了。
欢迎大佬提供方法!
Upgrade.sh
#!/bin/bash
get_char()#"请按任意键继续 函数"
{
SAVEDSTTY=`stty -g`
stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2> /dev/null
stty -raw
stty echo
stty $SAVEDSTTY
}
echo "Press any key to continue!"
echo "This is a auto-system-upgrade script."
echo "Starting process now..."
apt update && apt -y full-upgrade
echo "Normal command finished, now 'dist-upgrade'..."
apt-get -y dist-upgrade
echo "Fixing dependencies..."
apt-get -f install
echo "Cleaning caches and remove unuseful packages..."
apt clean
apt -y autoremove
echo "Done."
#引用开头函数
echo "Press any key to continue!"
get_char