Desktop: Kubuntu, Version: 7.04 Feisty Fawn
************************************
Hi,
I would like to run a shell script using a desktop link to that script, avoiding to open a terminal and to type the command. However, being rather new to Linux/Kubuntu, till now this fails. How can I do it?
Background
---------------
The script I created is /usr/local/sbin/downUpWLAN:
It is executable:
In sudoers, I did set access rights to downUpWLAN for all users (last line) using "sudo visudo":
#
If I type in a terminal "downUpWLAN", the script works beatuifully:
* I have to type in my log-in password
* then ifdown wlan0 starts, outputs messages
* after 30 seconds ifup wlan0 starts, outputs messages
* now my wireless internetconnection is active, if it wasn't before
The problem
---------------
If I place a link from downUpWLAN to my Desktop using
<Alt>+<F2>kdesu konqueror
...nothing happens if I klick this link. No demand for the password, no message output, no network activation. However, when I put a line into downUpWLAN such:
the file output.txt. is created on my desktop. Thus, linking works for a text output. But how can I get the commands "sudo ifdown wlan0" and "sudo ifup wlan0" to work?
Any suggestions, please?
Case somebody wants to know
---------------------------------------
I connect to the internet wirelessly with AVM Fritz!Stick USB/Fritz!Box WLAN. The connection is steady and runs smoothly, once established. But most often, first I have to use the two "ifdown..." "ifup..." commands after a start or reboot. I want to stick to this routine for some time to better get to know my system and learn some scripting on the way.
Thanks,
Siggi
************************************
Hi,
I would like to run a shell script using a desktop link to that script, avoiding to open a terminal and to type the command. However, being rather new to Linux/Kubuntu, till now this fails. How can I do it?
Background
---------------
The script I created is /usr/local/sbin/downUpWLAN:
#!/bin/bash
sudo ifdown wlan0
sleep 30
sudo ifup wlan0
exit 0
sudo ifdown wlan0
sleep 30
sudo ifup wlan0
exit 0
-rwxr-xr-x 1 root root 55 2007-08-08 21:31 downUpWLAN
#
/etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults
Defaults !lecture,tty_tickets,!fqdn
# User privilege specification
root ALL=(ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# All users may run downUpWLAN
%users ALL=NOPASSWD: /usr/local/sbin/downUpWLAN
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults
Defaults !lecture,tty_tickets,!fqdn
# User privilege specification
root ALL=(ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# All users may run downUpWLAN
%users ALL=NOPASSWD: /usr/local/sbin/downUpWLAN
* I have to type in my log-in password
* then ifdown wlan0 starts, outputs messages
* after 30 seconds ifup wlan0 starts, outputs messages
* now my wireless internetconnection is active, if it wasn't before
The problem
---------------
If I place a link from downUpWLAN to my Desktop using
<Alt>+<F2>kdesu konqueror
...nothing happens if I klick this link. No demand for the password, no message output, no network activation. However, when I put a line into downUpWLAN such:
echo Hello >> /<path to my desktop>/output.txt
Any suggestions, please?
Case somebody wants to know
---------------------------------------
I connect to the internet wirelessly with AVM Fritz!Stick USB/Fritz!Box WLAN. The connection is steady and runs smoothly, once established. But most often, first I have to use the two "ifdown..." "ifup..." commands after a start or reboot. I want to stick to this routine for some time to better get to know my system and learn some scripting on the way.
Thanks,
Siggi
Comment