parent
4add8e8273
commit
7346e7b1ab
@ -23,29 +23,25 @@ function update_script() {
|
|||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -d "/opt/revealjs" ]]; then
|
if [[ ! -d "/opt/revealjs" ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/hakimel/reveal.js/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
RELEASE=$(curl -fsSL https://api.github.com/repos/hakimel/reveal.js/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
if [[ "${RELEASE}" != "$(cat ~/.revealjs 2>/dev/null)" ]] || [[ ! -f ~/.revealjs ]]; then
|
||||||
msg_info "Stopping $APP"
|
msg_info "Stopping $APP"
|
||||||
systemctl stop revealjs
|
systemctl stop revealjs
|
||||||
msg_ok "Stopped $APP"
|
msg_ok "Stopped $APP"
|
||||||
|
|
||||||
msg_info "Updating $APP to ${RELEASE}"
|
|
||||||
temp_file=$(mktemp)
|
|
||||||
curl -fsSL "https://github.com/hakimel/reveal.js/archive/refs/tags/${RELEASE}.tar.gz" -o "$temp_file"
|
|
||||||
tar zxf $temp_file
|
|
||||||
rm -rf /opt/revealjs/node_modules/*
|
|
||||||
cp /opt/revealjs/index.html /opt
|
cp /opt/revealjs/index.html /opt
|
||||||
cp -rf reveal.js-${RELEASE}/* /opt/revealjs
|
fetch_and_deploy_gh_release "revealjs" "hakimel/reveal.js" "tarball"
|
||||||
|
|
||||||
|
msg_info "Updating $APP to ${RELEASE}"
|
||||||
cd /opt/revealjs
|
cd /opt/revealjs
|
||||||
$STD npm install
|
$STD npm install
|
||||||
cp -f /opt/index.html /opt/revealjs
|
cp -f /opt/index.html /opt/revealjs
|
||||||
sed -i '25s/localhost/0.0.0.0/g' /opt/revealjs/gulpfile.js
|
sed -i '25s/localhost/0.0.0.0/g' /opt/revealjs/gulpfile.js
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
|
||||||
msg_ok "Updated $APP to ${RELEASE}"
|
msg_ok "Updated $APP to ${RELEASE}"
|
||||||
|
|
||||||
msg_info "Starting $APP"
|
msg_info "Starting $APP"
|
||||||
@ -53,8 +49,7 @@ curl -fsSL "https://github.com/hakimel/reveal.js/archive/refs/tags/${RELEASE}.ta
|
|||||||
msg_ok "Started $APP"
|
msg_ok "Started $APP"
|
||||||
|
|
||||||
msg_info "Cleaning Up"
|
msg_info "Cleaning Up"
|
||||||
rm -f $temp_file
|
rm -f /opt/index.html
|
||||||
rm -rf ~/reveal.js-${RELEASE}
|
|
||||||
msg_ok "Cleanup Completed"
|
msg_ok "Cleanup Completed"
|
||||||
|
|
||||||
msg_ok "Update Successful"
|
msg_ok "Update Successful"
|
||||||
|
@ -14,17 +14,12 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
NODE_VERSION="22" setup_nodejs
|
NODE_VERSION="22" setup_nodejs
|
||||||
|
fetch_and_deploy_gh_release "revealjs" "hakimel/reveal.js" "tarball"
|
||||||
|
|
||||||
msg_info "Setup ${APPLICATION}"
|
msg_info "Configuring ${APPLICATION}"
|
||||||
temp_file=$(mktemp)
|
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/hakimel/reveal.js/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
|
||||||
curl -fsSL "https://github.com/hakimel/reveal.js/archive/refs/tags/${RELEASE}.tar.gz" -o "$temp_file"
|
|
||||||
tar zxf $temp_file
|
|
||||||
mv reveal.js-${RELEASE}/ /opt/revealjs
|
|
||||||
cd /opt/revealjs
|
cd /opt/revealjs
|
||||||
$STD npm install
|
$STD npm install
|
||||||
sed -i '25s/localhost/0.0.0.0/g' /opt/revealjs/gulpfile.js
|
sed -i '25s/localhost/0.0.0.0/g' /opt/revealjs/gulpfile.js
|
||||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
|
||||||
msg_ok "Setup ${APPLICATION}"
|
msg_ok "Setup ${APPLICATION}"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
@ -50,7 +45,6 @@ motd_ssh
|
|||||||
customize
|
customize
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
rm -f $temp_file
|
|
||||||
$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…
x
Reference in New Issue
Block a user