Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 <<.HTMLCategory scores: ${HINT}
.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 formatRequirement for quizes:
.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
For this Class Grade ...Score this % A $reqdForA B $reqdForB C $reqdForC
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started