From 90b5a6b3306789a1c82acd719ac7d94ef7cda0eb Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Tue, 30 Jul 2024 20:06:52 -0400 Subject: [PATCH] Update Debian packaging files Signed-off-by: Gerard Hickey --- package/debian/control | 2 +- package/debian/postinst | 32 -------------------------------- package/debian/preinst | 12 ++++++------ 3 files changed, 7 insertions(+), 39 deletions(-) diff --git a/package/debian/control b/package/debian/control index 27438a1..d846370 100644 --- a/package/debian/control +++ b/package/debian/control @@ -1,6 +1,6 @@ Package: meshchat Version: -Depends: lua5.4 +Depends: lua5.4, nginx Provides: Source: package/meshchat Section: net diff --git a/package/debian/postinst b/package/debian/postinst index 67004c2..7394745 100755 --- a/package/debian/postinst +++ b/package/debian/postinst @@ -1,38 +1,6 @@ #!/bin/sh -grep "|8080|meshchat" /etc/config.mesh/_setup.services.dmz &> /dev/null -DMZPRESENT=$? -grep "|8080|meshchat" /etc/config.mesh/_setup.services.nat &> /dev/null -NATPRESENT=$? -NODEMODE=$(uci -q -c /etc/local/uci/ get hsmmmesh.settings.config) -RAND=$(awk 'BEGIN{srand();print int(rand()*10000) }') -RESTART=0 - -if [ "$DMZPRESENT" != 0 ]; then - echo "MeshChat-$RAND|1|http|$(uname -n)|8080|meshchat" >> /etc/config.mesh/_setup.services.dmz - RESTART=1 -fi - -if [ "$NATPRESENT" != 0 ]; then - echo "MeshChat-$RAND|1|http|$(uname -n)|8080|meshchat" >> /etc/config.mesh/_setup.services.nat - RESTART=1 -fi - -if [ "$NODEMODE" = "mesh" -a "$RESTART" = "1" ]; then - echo "Applying service announcement" - /usr/local/bin/node-setup -a -p mesh &> /dev/null - /etc/init.d/olsrd restart &> /dev/null -fi - /etc/init.d/meshchatsync enable /etc/init.d/meshchatsync start -echo "
" - -echo "Mesh Chat has been setup at http://$(uname -n):8080/meshchat" -echo "
" -if [ "$RESTART" = "1" ]; then - echo "An advertised service has been added for Mesh Chat on the Services configuration page" -fi - exit 0 diff --git a/package/debian/preinst b/package/debian/preinst index 9864975..29acc87 100755 --- a/package/debian/preinst +++ b/package/debian/preinst @@ -2,17 +2,17 @@ /etc/init.d/meshchatsync stop > /dev/null 2> /dev/null -mkdir -p /www/meshchat +mkdir -p /var/www/html/meshchat # if there is not a meshchat_local.lua, then prepare one -if [ ! -f /www/cgi-bin/meshchat_local.lua ]; then - if [ -f /www/cgi-bin/meshchatconfig.lua ]; then - cp /www/cgi-bin/meshchatconfig.lua /www/cgi-bin/meshchat_local.lua +if [ ! -f /usr/lib/cgi-bin/meshchat_local.lua ]; then + if [ -f /usr/lib/cgi-bin/meshchatconfig.lua ]; then + cp /usr/lib/cgi-bin/meshchatconfig.lua /usr/lib/cgi-bin/meshchat_local.lua # remove vars that should not be in meshchat_local.lua - sed -i "/^protocol_version/d; /^app_version/d" /www/cgi-bin/meshchat_local.lua + sed -i "/^protocol_version/d; /^app_version/d" /usr/lib/cgi-bin/meshchat_local.lua else - touch /www/cgi-bin/meshchat_local.lua + touch /usr/lib/cgi-bin/meshchat_local.lua fi fi