34 lines
800 B
Bash
34 lines
800 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
###############################################
|
||
|
# Upgrade to mainline #########################
|
||
|
|
||
|
yes Y | apt update
|
||
|
yes Y | apt upgrade
|
||
|
|
||
|
|
||
|
|
||
|
###############################################
|
||
|
# Parse index.html with latest dev versions ###
|
||
|
|
||
|
# Here we cut like:
|
||
|
# <a href="0.1.0.1653/">0.1.0.1653/</a>
|
||
|
# to
|
||
|
# 0.1.0.1653
|
||
|
|
||
|
wget http://storage-url/package-name/dev/
|
||
|
recent_develop="$(cat index.html | tail -n 3 | head -n 1 | cut -f 2 -d '>' | cut -f 1 -d '<' | cut -f 1 -d '/')"
|
||
|
echo "Actual dev version: $recent_develop"
|
||
|
rm *index*
|
||
|
|
||
|
|
||
|
|
||
|
###############################################
|
||
|
# Downloading the actual version ##############
|
||
|
|
||
|
wget http://storage-url/package-name/dev/${recent_develop}/package-name-${recent_develop}-Linux.deb
|
||
|
yes Y | dpkg -i *.deb
|
||
|
rm *.deb
|
||
|
|
||
|
|
||
|
systemctl restart package-name
|