-
Notifications
You must be signed in to change notification settings - Fork 0
/
raspi-config
34 lines (29 loc) · 1.08 KB
/
raspi-config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
function install_raspi(){
latest=$(curl https://archive.raspberrypi.org/debian/pool/main/r/raspi-config/ | egrep -o "raspi-config_[0-9]{8}_all.deb" |sort -rn)
url="https://archive.raspberrypi.org/debian/pool/main/r/raspi-config/"
cd /tmp
wget $url${latest: 0 :29}
sudo apt-get install -y lua5.1 libatopology2 libfftw3-single3 libsamplerate0 alsa-utils whiptail parted initramfs-tools
sudo dpkg -i ${latest: 0 :29}
echo "install completed"
rm -f ${latest: 0 :29}
}
echo "raspi-config安装脚本"
if ! [ -x "$(command -v raspi-config)" ]; then
echo 'raspi-config is not installed.' >&2
echo '现在开始安装...' >&2
install_raspi
echo "raspi-config已经安装"
exit 1
else
latest_version=$(curl https://archive.raspberrypi.org/debian/pool/main/r/raspi-config/ | egrep -o "raspi-config_[0-9]{8}_all.deb" |sort -rn)
version=$(dpkg -l | grep raspi-config)
if [[ "${version: 16 :8}"=="${latest_version: 13 :8}" ]]
then
echo "版本为最新,不需要更新,当前版本为:"
echo `dpkg -l | grep raspi-config`
else
install_raspi
fi
fi