Files
rx3-base/www/cgi-bin/urpmi-setup-dump.cgi
Arnaud G. GIBERT ab1c43634a - Move lib dir into top dir & remove usr,
- Add www/cgi-bin dir,
- Add urpmi-setup-dump.cgi and package it as example,
- URPMI-Setup:
    - Fix usage message.
2026-04-20 16:22:25 +02:00

62 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
#-----------------------------------------------------------------------------------------------------------------------------------
#
# URPMI Setup CGI
#
# Copyright (C) 2026 Arnaud G. GIBERT
# mailto:arnaud@rx3.net
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; If not, see
# <https://www.gnu.org/licenses/>.
#
#-----------------------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------------------
# Includes
#-----------------------------------------------------------------------------------------------------------------------------------
: "${RX3_LIB_DIR:=/usr/lib/rx3}"
. "${RX3_LIB_DIR}/docker_tools.bash"
#-----------------------------------------------------------------------------------------------------------------------------------
# Main
#-----------------------------------------------------------------------------------------------------------------------------------
echo "Content-type: text/plain"
echo ""
if [[ -n "${QUERY_STRING}" ]]
then
if [[ "$QUERY_STRING" =~ ^[a-z0-9]+$ ]]
then
DISTRIB_OPT="-d ${QUERY_STRING}"
else
echo "Error: Invalid characters in query string."
exit 1
fi
else
DISTRIB_OPT=""
fi
urpmi-setup -v -D ${DISTRIB_OPT}