Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Hilfe für runscript gesucht.
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
Verwirrt
n00b
n00b


Joined: 28 Sep 2006
Posts: 19

PostPosted: Tue Jan 09, 2007 3:53 pm    Post subject: Hilfe für runscript gesucht. Reply with quote

Hi Leute,

ich bastel gerade ein wenig am Powermanagement. Dabei bin ich auf folgendes Problem gestoßen:
Ich habe ein Runlevel battery angelegt das soweit auch funktioniert. (wird gestartet wenn Netzkabel ab)
Nun möchte ich, dass meine LCD-Helligkeit automatisch runtergesetzt wird wenn ich ins battery-Runlevel wechsel. Leider ist die für mich einzige bekannte Möglichkeit die Display Helligkeit für mein Laptop zu regeln ein kleines Programm namens "s1bl". (Laptop Toshiba M40-265, FN-Keys funzen ja leider nicht)
Wie kriege ich das mit einem runscript gebacken? Ich habs mit stinknormalen aufrufen von "s1bl" in der Start-Section probiert, leider führt das zu Syntax-Fehlern.
Eigentlich möchte ich ja nur, dass beim wechsel nach battery "s1bl -s 0" und beim rausgehen "s1bl -s 7" ausgeführt wird. Wie stelle ich das an?
Über Hinweise wie man die FN-Keys bei diesem Laptop zum laufen bekommt wäre ich natürlich auch nicht traurig.
Hinweis: Standard Toshiba Tools für Linux und Toshiba Kernel Unterstützung funktionieren bei diesem China-Modell anscheinend nicht.

Danke im Voraus!
Gruss
V.
Back to top
View user's profile Send private message
firefly
Watchman
Watchman


Joined: 31 Oct 2002
Posts: 5331

PostPosted: Tue Jan 09, 2007 4:21 pm    Post subject: Reply with quote

zeig doch mal was du bisher hast vom init-script und was für einen syntax-fehler kommt.
_________________
Ein Ring, sie zu knechten, sie alle zu finden,
Ins Dunkel zu treiben und ewig zu binden
Im Lande Mordor, wo die Schatten drohn.
Back to top
View user's profile Send private message
Verwirrt
n00b
n00b


Joined: 28 Sep 2006
Posts: 19

PostPosted: Tue Jan 09, 2007 6:00 pm    Post subject: Reply with quote

Hi,

eigtl. habe ich sogut wie gar nichts. Alles was ich getan habe ist eine /etc/init.d/lcd_dim zu erstellen.

Code:

#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {

}

start() {
        /usr/bin/s1bl -s 0
}

stop() {
        /usr/bin/s1bl -s 7
}

restart() {
        /usr/bin/s1bl -s 0
}



Dann ein: chmod +x /etc/init.d/lcd_dim
Anschließend: rc-update add lcd_dim battery

Fehlermeldung:
Code:

rc-scripts: ERROR:  /etc/init.d/lcd_dim has syntax errors in it; aborting ...


Wie man unschwer an der komplexität und der schlichten Eleganz meiner lcd_dim erkennen kann, habe ich nicht wirklich Ahnung davon was da rein muss.

Gruss
V.

EDIT: Sorry Datei war nicht vollständig.


Last edited by Verwirrt on Tue Jan 09, 2007 7:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Germany

PostPosted: Tue Jan 09, 2007 6:59 pm    Post subject: Reply with quote

Wenn das die komplette Datei ist oben, dann fehlt am Ende eine schließende geschweifte Klammer, um die restart() Funktion zu beenden. IIRC brauchst du die aber gar nicht zu implementieren, solltest du also besser ganz rauslöschen.
_________________
KDE
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