initial import
This commit is contained in:
parent
f8b4ed3351
commit
a8b69a8db2
35 changed files with 11590 additions and 0 deletions
35
bin/debup.sh
Executable file
35
bin/debup.sh
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo "Clearing journald > 30 days"
|
||||
sudo journalctl --vacuum-time=30d
|
||||
|
||||
echo "Applying system upgrades"
|
||||
sudo apt-get update
|
||||
sudo apt-get autoclean
|
||||
sudo apt-get upgrade
|
||||
|
||||
## rclone in LTS is too old
|
||||
function upgrade_rclone() {
|
||||
echo "Checking rclone..."
|
||||
# get installed version
|
||||
_LOCAL=$(dpkg-query --showformat='${Version}' --show rclone)
|
||||
|
||||
# get latest version, strip leading "v" (v1.55.1 -> 1.55.1)
|
||||
_REMOTE=$(curl -s "https://api.github.com/repos/rclone/rclone/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
|
||||
_REMOTE=${_REMOTE#v}
|
||||
|
||||
# bash doesn't see versions as numbers, but as strings
|
||||
if [[ "${_LOCAL}" != "${_REMOTE}" ]]; then
|
||||
echo "Upgrading rclone - installed ${_LOCAL}, latest ${_REMOTE}"
|
||||
curl -o /tmp/rclone-latest.deb \
|
||||
"https://downloads.rclone.org/rclone-current-linux-amd64.deb"
|
||||
if [[ $? -eq 0 ]]; then
|
||||
sudo apt-get install /tmp/rclone-latest.deb
|
||||
rm -f /tmp/rclone-latest.deb
|
||||
fi
|
||||
else
|
||||
echo "Installed rclone is the latest - ${_LOCAL}"
|
||||
fi
|
||||
}
|
||||
|
||||
upgrade_rclone
|
||||
Loading…
Add table
Add a link
Reference in a new issue