nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

required help for running a shell script from browser

This is a discussion on required help for running a shell script from browser within the Shell scripting forums, part of the Development/Scripting category; I am having following shell script. How do I run this script from browser. Can anybody give me a code ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 06-27-2006, 01:27 PM
Junior Member
 
Join Date: Jun 2006
Posts: 3
Rep Power: 0
vaishalichitale
Default required help for running a shell script from browser

I am having following shell script. How do I run this script from browser.
Can anybody give me a code for this script to run from browser

My script is:
#!/bin/sh
TERM=vt100; export TERM
clear
echo " ADD USER "
echo " ----------"
USERID=""
while [ "${USERID}" = "" ]
do
echo -n "Enter User-id: "
read USERID
done
TICKETNO=""
while [ "${TICKETNO}" = "" ]
do
echo -n "Enter Ticket No.: "
read TICKETNO
done
LOCATION=""
while [ "${LOCATION}" = "" ]
do
echo -n "Enter Location: "
read LOCATION
done
USERNAME=""
while [ "${USERNAME}" = "" ]
do
echo -n "Enter User Name: "
read USERNAME
done

echo "Id = $USERID"
echo "TicketNo = $TICKETNO"
echo "Location = $LOCATION"
echo "Name = $USERNAME"
echo -n "Are the above values OK? (Y/N): "
read ANS

if [ "${ANS}" = "Y" ]
then
/usr/sbin/adduser -g users -c "$TICKETNO-$LOCATION-$USERNAME" $USERID
passwd $USERID
fi
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-27-2006, 05:53 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

You cannot run a shell script from web page. First, you need to configure web server as a cgi-bin.

Next use php,perl or shell script that will display html text box, verify input and then add the user using sudo. See old post: http://www.cyberciti.biz/nixcraft/fo...opic.php?t=405


If you need to manage server (user add, change password etc) using web interface I recommend to use webmin program
http://www.webmin.com/
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
shell scripts required for students roni Shell scripting 6 07-20-2007 07:21 PM
running command a root in shell scripts chiku Shell scripting 1 07-17-2006 07:39 PM
running .sh script linux jerry Shell scripting 1 06-17-2006 02:45 PM
Shell,perl plsql programmer required (get paid) amitoverseas40 Solaris/OpenSolaris 0 08-13-2005 10:15 PM
Shell,perl plsql programmer required (get paid) amitoverseas40 Shell scripting 0 08-13-2005 10:12 PM


All times are GMT +5.5. The time now is 07:00 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36