linuxtool/Config/Automation/Installs/update.sh

18 lines
571 B
Bash
Raw Normal View History

declare update_path="$1"
2024-07-25 21:59:46 +08:00
echo '#!/bin/bash' > "${update_path}/update.sh"
if [[ -f "/usr/bin/apt" ]];then
echo 'sudo apt update -y' >> "${update_path}/update.sh"
echo 'sudo apt-get dist-upgrade -y' >> "${update_path}/update.sh"
elif [[ -f "/usr/bin/apt-get" ]];then
echo 'sudo apt-get update -y' >> "${update_path}/update.sh"
echo 'sudo apt dist-upgrade -y' >> "${update_path}/update.sh"
2024-09-22 23:13:33 +08:00
elif [[ -f "/usr/bin/pacman" ]];then
sudo pacman -Syu --noconfirm
else
rm "${update_path}/update.sh"
echo "暂不支持该系统的自动更新配置"
exit
fi