LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 05-28-2013, 01:51 AM   #1
amar@solus
LQ Newbie
 
Registered: Mar 2013
Posts: 10
Blog Entries: 1

Rep: Reputation: Disabled
how to execute/ run a linux commond from HTML page..?


In my project I have to run a unix commond from html page to change my IP address of my target board.
can some one suggest me how to achieve this.
 
Old 05-28-2013, 02:17 AM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
you need three things for that:
1. HTTP server with CGI support
2. a privileged daemon that can change IP-address (it can listen for commands on a socket or with named pipe or whatever you prefer)
3. CGI script that sends appropriate command to the daemon
 
Old 05-28-2013, 02:38 AM   #3
amar@solus
LQ Newbie
 
Registered: Mar 2013
Posts: 10
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
I have a commond "fw_setenv ipaddr 'ip'", this commond on target terminal will change the ip address in u-boot environment. when next time the target restarted will come up with same ip address which as in u-boot environment.

this is happing through terminal, but I want this need happen on onclick submit in HTML page.

In HTML page I will be mentioniong the Ip address and followed by submit,my fw_setenv ipaddr commond as to take ip address from HTML and execute.

I have HTML server with CGI support, please guide me how can i achieve the above with giving som example code.
 
Old 05-28-2013, 03:09 AM   #4
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
does fw_setenv have SUID (check with «stat» command)? if not, you still need a privileged daemon to run «fw_setenv»
 
Old 05-28-2013, 03:50 AM   #5
amar@solus
LQ Newbie
 
Registered: Mar 2013
Posts: 10
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
yeah its having, I want to know how should i call the fw_setenv to execute onclick in html.

where should i call that commond to execute in .cgi or .htm file and how can i call that..??
 
Old 05-28-2013, 04:23 AM   #6
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
just look at any CGI example for your preferable language
 
Old 05-28-2013, 04:05 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

This is the FOURTH thread of yours on the same topic.
 
  


Closed Thread

Tags
arch linux, embedded, linux


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Run bash command taking input from HTML page - CGI script vickyk Programming 6 04-16-2013 12:36 AM
Eclipse Run Configuration for an HTML page Jordan&&&& Programming 2 08-23-2010 02:50 PM
How to execute a shell script from a simple html web page Shreerang Patwardhan Linux - Software 7 03-11-2010 12:12 PM
PERL error trying to run simple HTML page.... vous Programming 1 08-25-2003 10:01 AM


All times are GMT -5. The time now is 12:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration