Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apche2 & samba per button starten
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
basti274
n00b
n00b


Joined: 26 Oct 2004
Posts: 5

PostPosted: Sun Nov 14, 2004 9:16 pm    Post subject: apche2 & samba per button starten Reply with quote

hallo,

ist es möglich den befehl: /etc/init.d/apache2 status/start/stop bzw. /etc/init.d/samba status/start/stop

per verknüpfung/button zu starten/stopen ?
Back to top
View user's profile Send private message
@4u
Apprentice
Apprentice


Joined: 13 Nov 2004
Posts: 160

PostPosted: Sun Nov 14, 2004 9:32 pm    Post subject: Reply with quote

In zwei Schritten zum Erfolg:

1. Vernüpfung zum Script "switch_local_network.sh" in KDE einrichten
Code:
kdesu /usr/local/sbin/switch_local_network.sh
als Pfad / Befehl im K-Menü oder als Verknüpfung auf dem Desktop

Im K-Menü gibt es meines Erachtens direkt die Option, etwas als einen anderen Benutzer ausführen zu lassen. Dies sollte man anstelle "kdesu" nutzen.

2. Script einrichten als /usr/local/sbin/switch_local_network.sh
Code:
#!/bin/sh

if /etc/init.d/apache2 status | grep -q "started"
then
   /etc/init.d/samba stop
   /etc/init.d/apache2 stop
else
   /etc/init.d/apache2 start
   /etc/init.d/samba start
fi


Sicherlich könnte man es noch besser ausschmücken - aber funktionieren wird es (außer es hat sich ein Tippfehler versteckt).

* Ohne Garantie
Back to top
View user's profile Send private message
basti274
n00b
n00b


Joined: 26 Oct 2004
Posts: 5

PostPosted: Sun Nov 14, 2004 9:44 pm    Post subject: Reply with quote

habe dass so eingerichtet wie von dir beschrieben jetzt kommt folgendes:

Password:
/bin/bash: line 1: /usr/local/sbin/switch_local_network.sh: Keine Berechtigung
Back to top
View user's profile Send private message
@4u
Apprentice
Apprentice


Joined: 13 Nov 2004
Posts: 160

PostPosted: Sun Nov 14, 2004 10:11 pm    Post subject: Reply with quote

chmod 0755 /usr/local/sbin/switch_local_network.sh
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum