Question: UNIX: Use the sample code to instead create a help desk that creates support tickets from users that can run on an apache server. Inputs

UNIX: Use the sample code to instead create a help desk that creates support tickets from users that can run on an apache server.

Inputs should ask for:

Requester's name.

email of the requester.

What kind of problem they are having: Software / Hardware / Legal / General

The description of the problem.

Input responses should be saved and stored as a txt file.

SAMPLE CODE FOR USE:

#!/bin/bash # # Web solution: #### CUSTOMIZE FOR SOLUTION: TITLE="What score do you need on the quizes?" DESC="Calculate quizes scores required to receive a class grade, based on category scores" SAMPLE_INPUTS="assignments=90&quizzes=77&midterm=88"; SAMPLE_HINT="(sample shown)" #### # Deployment: Apache web server, basic Unix/Linux utilities, bash shell or compatible interpreter. # Get CGI-provided inputs, and eval to set variables. (NO CHANGES NEEDED) if [[ -z "$QUERY_STRING" ]]; then QUERY_STRING="$SAMPLE_INPUTS"; HINT=$SAMPLE_HINT fi INPUTS=$(echo "$QUERY_STRING" |sed -E 's/&?(\w+)=([^&]+)/\1=\2;/g') eval $INPUTS # Output CGI response header. (NO CHANGES NEEDED) # NOTE empty line REQUIRED after "Content-type". cat <<.CGI Content-type: text/html .CGI # Output any server errors, to aid debugging. (NO CHANGES NEEDED) exec 2>&1 # Output inputs/results web page header. (NO CHANGES NEEDED) if [[ -z "$O" ]]; then # (Web service "O"utput format would suppress HTML output) cat <<.HTML   $TITLE  

$TITLE

$DESC

.HTML # Output form with inputs/samples to prompt for inputs. #### CUSTOMIZE FOR SOLUTION: cat <<.HTML

Category scores: ${HINT}

Assignments:
Quizzes:
Midterm:
.HTML ####
echo '' fi # (Web service "O"utput format would suppress HTML output) # Process inputs to generate results. #### CUSTOMIZE FOR SOLUTION: reqdForA=$(( (900 - (3*$assignments) - (2*$quizzes) - (2*$midterm)) / 3 )) reqdForB=$(( (800 - (3*$assignments) - (2*$quizzes) - (2*$midterm)) / 3 )) reqdForC=$(( (700 - (3*$assignments) - (2*$quizzes) - (2*$midterm)) / 3 )) #### # Output results. if [[ -z "$O" ]]; then # (Web service "O"utput format would suppress HTML output) echo '' #### CUSTOMIZE FOR SOLUTION: cat <<.HTML # Output in web app format

Requirement for quizes:

For this Class Grade ...Score this %
A $reqdForA
B $reqdForB
C $reqdForC
.HTML else # "O"utput in web service format cat <<.CSV # Output CSV $reqdForA, $reqdForB, $reqdForC .CSV ####
fi # (Web service "O"utput format would suppress HTML output) # Output detailed "A"bout information, if applicable. (NO CHANGES NEEDED) if [[ ! -z "$A" ]]; then cat <<.HTML

Usage:
http://${SERVER_NAME}${SCRIPT_NAME}?$QUERY_STRING Options: O=format ("O"utput results in web service format); A=YES (show "A"bout solution)
.HTML fi # "A"bout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!