LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-20-2006, 01:38 PM   #1
KaYoS
Member
 
Registered: May 2006
Posts: 32

Rep: Reputation: 15
Tcl Tk script question


Hi there

Im trying to get a script running under slackware, ive modified it so it should work, however parts of it do, and parts of it dont

Code:
#!/usr/bin/env wish
set sshcommand "/etc/rc.d/rc.sshd";
global sshcommand;
proc sshstart {} {
global $sshcommand start &;
}
proc sshstop {} {
global sshcommand;
exec $sshcommand stop &;
}
proc launchbrowser {} { exec firefox &;}
proc launcheditor {} { exec pico &; }
frame .app -borderwidth 10;
.app configure -background lightblue;
pack .app;
button .app.ssh-go -text "Start SSHD" -command sshstart;
button .app.ssh-end -text "Stop SSHD" -command sshstop;
button .app.browser -text "Web Browser" -command launchbrowser;
button .app.launcheditor -text "Text Editor" -command launcheditor;
.app.ssh-go configure -foreground green;
.app.ssh-end configure -foreground red;
pack .app.ssh-go .app.ssh-end .app.browser .app.launcheditor;
When run as root, the Stop SSHD part works, but the Start SSHD doesnt, both the firefox and pico launcher work as well.

Also, how do i stop the services running at startup, i want to be able to start the services once the system is running, as it will be (eventually) deployed ona laptop, so i will extend it to include other scripts, i just dont want it to spend ages looking for an ip via dhcp if its not connected to the network, and when it is connected i just want to press "Start Network"

Thanks in advance for any help!
 
Old 11-20-2006, 02:30 PM   #2
KaYoS
Member
 
Registered: May 2006
Posts: 32

Original Poster
Rep: Reputation: 15
Right, well after a break, i spotted my sytax error, so i alterd that and it works now, however upon trying to alter the script to do more things, i hit another problem.

Code:
#!/usr/bin/env wish
set netcommand "/etc/rc.d/rc.inet1";
global netcommand;
proc netstart {} {
global netcommand
exec $netcommand start &;
}
proc netstop {} {
global netcommand;
exec $netcommand stop &;
}
proc launchbrowser {} { exec firefox &;}
proc launcheditor {} { exec pico &; }
frame .app -borderwidth 10;
.app configure -background lightblue;
pack .app;
button .app.ssh-go -text "Start Net" -command netstart;
button .app.ssh-end -text "Stop Net" -command netstop;
button .app.browser -text "Web Browser" -command launchbrowser;
button .app.launcheditor -text "Text Editor" -command launcheditor;
.app.ssh-go configure -foreground green;
.app.ssh-end configure -foreground red;
pack .app.ssh-go .app.ssh-end .app.browser .app.launcheditor;
Now the "Stop Net" function works, But uppon pressing "Start Net" i am unable to connect to the network, altho i dont get an error

Any ideas?
 
  


Reply



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
2 in 1 - dropline-gnome question and tcl question sl4ckw4re Slackware 7 07-24-2006 11:08 AM
tcl script maphin Linux - General 1 05-18-2006 10:43 AM
use file content as tcl script parameters powah Linux - General 3 07-16-2005 11:10 AM
How to start a Tcl/Tk script by simply invoking the script file itself ? cyu021 Programming 2 10-10-2004 11:00 AM
How to register a Tcl script as a service? vlbaranov Linux - Newbie 2 06-01-2004 10:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:05 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
Open Source Consulting | Domain Registration