parent
39b9cfcffc
commit
66687c0d21
@ -27,17 +27,25 @@ function update_script() {
|
|||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
msg_info "Updating $APP"
|
|
||||||
|
RELEASE=$(curl -fsSL https://api.github.com/repos/aceberg/WatchYourLAN/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||||
|
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||||
|
msg_info "Stopping service"
|
||||||
systemctl stop watchyourlan.service
|
systemctl stop watchyourlan.service
|
||||||
cp -R /data/config.yaml config.yaml
|
msg_ok "Service stopped"
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/aceberg/WatchYourLAN/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d '"' -f 4)
|
|
||||||
curl -fsSL "https://github.com/aceberg/WatchYourLAN/releases/download/$RELEASE/watchyourlan_${RELEASE}_linux_amd64.deb" -o $(basename "https://github.com/aceberg/WatchYourLAN/releases/download/$RELEASE/watchyourlan_${RELEASE}_linux_amd64.deb")
|
cp -R /data/config.yaml ~/config.yaml
|
||||||
dpkg -i watchyourlan_${RELEASE}_linux_amd64.deb
|
fetch_and_deploy_gh_release "watchyourlan" "aceberg/WatchYourLAN" "binary"
|
||||||
cp -R config.yaml /data/config.yaml
|
cp -R config.yaml /data/config.yaml
|
||||||
sed -i 's|/etc/watchyourlan/config.yaml|/data/config.yaml|' /lib/systemd/system/watchyourlan.service
|
sed -i 's|/etc/watchyourlan/config.yaml|/data/config.yaml|' /lib/systemd/system/watchyourlan.service
|
||||||
rm watchyourlan_${RELEASE}_linux_amd64.deb config.yaml
|
|
||||||
|
msg_info "Cleaning up"
|
||||||
|
rm ~/config.yaml
|
||||||
|
msg_ok "Cleaned up"
|
||||||
|
|
||||||
|
msg_info "Starting service"
|
||||||
systemctl enable -q --now watchyourlan
|
systemctl enable -q --now watchyourlan
|
||||||
msg_ok "Updated $APP"
|
msg_ok "Service started"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,14 +14,15 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y {arp-scan,ieee-data,libwww-perl}
|
$STD apt-get install -y \
|
||||||
|
arp-scan \
|
||||||
|
ieee-data \
|
||||||
|
libwww-perl
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Installing WatchYourLAN"
|
fetch_and_deploy_gh_release "watchyourlan" "aceberg/WatchYourLAN" "binary"
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/aceberg/WatchYourLAN/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d '"' -f 4)
|
|
||||||
curl -fsSL "https://github.com/aceberg/WatchYourLAN/releases/download/$RELEASE/watchyourlan_${RELEASE}_linux_amd64.deb" -o "watchyourlan_${RELEASE}_linux_amd64.deb"
|
msg_info "Configuring WatchYourLAN"
|
||||||
$STD dpkg -i watchyourlan_${RELEASE}_linux_amd64.deb
|
|
||||||
rm watchyourlan_${RELEASE}_linux_amd64.deb
|
|
||||||
mkdir /data
|
mkdir /data
|
||||||
cat <<EOF >/data/config.yaml
|
cat <<EOF >/data/config.yaml
|
||||||
arp_timeout: "500"
|
arp_timeout: "500"
|
||||||
@ -41,7 +42,7 @@ shoutrrr_url: ""
|
|||||||
theme: solar
|
theme: solar
|
||||||
timeout: 60
|
timeout: 60
|
||||||
EOF
|
EOF
|
||||||
msg_ok "Installed WatchYourLAN"
|
msg_ok "Configured WatchYourLAN"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
sed -i 's|/etc/watchyourlan/config.yaml|/data/config.yaml|' /lib/systemd/system/watchyourlan.service
|
sed -i 's|/etc/watchyourlan/config.yaml|/data/config.yaml|' /lib/systemd/system/watchyourlan.service
|
||||||
|
Loading…
x
Reference in New Issue
Block a user