mirror of https://github.com/tteck/Proxmox.git
Compare commits
6 Commits
4c3d35242c
...
c451bea9d3
Author | SHA1 | Date |
---|---|---|
tteckster | c451bea9d3 | |
CanbiZ | 35789659df | |
CanbiZ | f7b5b584cc | |
CanbiZ | e74402749d | |
CanbiZ | f365a91a44 | |
CanbiZ | 9a923c4c1a |
30
ct/evcc.sh
30
ct/evcc.sh
|
@ -53,33 +53,11 @@ function default_settings() {
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
if [[ ! -d /usr/bin/evcc ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
if [[ ! -f /etc/apt/sources.list.d/evcc-stable.list ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||||
if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then
|
msg_info "Updating evcc LXC"
|
||||||
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
|
apt update &>/dev/null
|
||||||
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
|
apt install -y evcc &>/dev/null
|
||||||
fi
|
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/evcc-io/evcc/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-4) }')
|
|
||||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
|
||||||
msg_info "Stopping ${APP}"
|
|
||||||
systemctl stop evcc
|
|
||||||
msg_ok "${APP} Stopped"
|
|
||||||
|
|
||||||
msg_info "Updating ${APP} to ${RELEASE}"
|
|
||||||
wget -q "https://github.com/evcc-io/evcc/releases/download/${RELEASE}/evcc_${RELEASE}_amd64.deb"
|
|
||||||
$STD dpkg -i evcc_${RELEASE}_amd64.deb
|
|
||||||
msg_ok "Updated Successfully"
|
msg_ok "Updated Successfully"
|
||||||
|
|
||||||
msg_info "Starting ${APP}"
|
|
||||||
systemctl start evcc
|
|
||||||
msg_ok "Started ${APP}"
|
|
||||||
|
|
||||||
msg_info "Cleaning Up"
|
|
||||||
rm -rf evcc_${RELEASE}_amd64.deb
|
|
||||||
msg_ok "Cleaned"
|
|
||||||
msg_ok "Updated Successfully"
|
|
||||||
else
|
|
||||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
|
||||||
fi
|
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,21 +19,26 @@ msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y \
|
$STD apt-get install -y \
|
||||||
curl \
|
curl \
|
||||||
sudo \
|
sudo \
|
||||||
mc
|
mc \
|
||||||
|
lsb-release \
|
||||||
|
gpg
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/evcc-io/evcc/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
msg_info "Setting up evcc Repository"
|
||||||
msg_info "Installing ${APPLICATION} ${RELEASE}"
|
curl -fsSL https://dl.evcc.io/public/evcc/stable/gpg.EAD5D0E07B0EC0FD.key | gpg --dearmor -o /etc/apt/keyrings/evcc-stable.gpg
|
||||||
wget -q "https://github.com/evcc-io/evcc/releases/download/${RELEASE}/evcc_${RELEASE}_amd64.deb"
|
echo "deb [signed-by=/etc/apt/keyrings/evcc-stable.gpg] https://dl.evcc.io/public/evcc/stable/deb/debian $(lsb_release -cs) main" >/etc/apt/sources.list.d/evcc-stable.list
|
||||||
$STD dpkg -i evcc_${RELEASE}_amd64.deb
|
$STD apt update
|
||||||
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
msg_ok "evcc Repository setup sucessfully"
|
||||||
msg_ok "Installed ${APPLICATION} ${RELEASE}"
|
|
||||||
|
msg_info "Installing evcc"
|
||||||
|
$STD apt install -y evcc
|
||||||
|
systemctl enable -q --now evcc.service
|
||||||
|
msg_ok "Installed evcc"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
rm -rf evcc_${RELEASE}_amd64.deb
|
|
||||||
$STD apt-get -y autoremove
|
$STD apt-get -y autoremove
|
||||||
$STD apt-get -y autoclean
|
$STD apt-get -y autoclean
|
||||||
msg_ok "Cleaned"
|
msg_ok "Cleaned"
|
Loading…
Reference in New Issue