Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users Forum italiano (Italian)
  • Search

Utile (forse) script per chi usa il portatile

Questa è la sezione italiana del forum gentoo destinata a fornire supporto all'omonima distribuzione.

Moderator: ago

Post Reply
  • Print view
Advanced search
9 posts • Page 1 of 1
Author
Message
mrfree
Veteran
Veteran
User avatar
Posts: 1303
Joined: Sat Mar 15, 2003 6:31 pm
Location: Europe.Italy.Sulmona

Utile (forse) script per chi usa il portatile

  • Quote

Post by mrfree » Tue Apr 29, 2003 2:54 pm

Consiglio a tutti quelli che come me hanno bisogno di switchare diverse configurazioni, presumibilmente su un portatile e principalmente in base al giorno della settimana ... questo semplice init script

Code: Select all

#!/sbin/runscript
# Copyright 2003 Frittella Laurento - MrFree
# Distributed under the terms of the GNU General Public License v2

# Profilo utilizzato in ufficio (Giorni Feriali)
OFFICE="Ufficio"
# Profilo utilizzato a casa (Giorni Festivi)
HOME="Casa"


TODAY=$(date +%a)

depend() {
        need net
        need clock
}

start() {
        ebegin "QuickSwitch of the Day ;) "

        case "$TODAY" in
           Mon | Tue | Wed | Thu | Fri )
                switchto $OFFICE &> /dev/null
           ;;
           Sat | Sun )
                switchto $HOME &> /dev/null
           ;;
        esac

        eend 0
}
Visto che ne avevo bisogno subito mi sono limitato a questo, ma se vi interessa in seguito potrei postare la versione che considera orario di lavoro e giorni di festa o di ferie, ovviamente indicati in un file di configurazione.

Ahhhh... compagno quickswitch :D
Please EU, pimp my country!

ICE: /etc/init.d/iptables panic
Top
cerri
Bodhisattva
Bodhisattva
User avatar
Posts: 2957
Joined: Wed Mar 05, 2003 5:36 am
Location: # init S
Contact:
Contact cerri
Website

  • Quote

Post by cerri » Tue Apr 29, 2003 3:16 pm

Code: Select all

switchto
?
Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito
Top
mrfree
Veteran
Veteran
User avatar
Posts: 1303
Joined: Sat Mar 15, 2003 6:31 pm
Location: Europe.Italy.Sulmona

  • Quote

Post by mrfree » Tue Apr 29, 2003 3:24 pm

switchto
fa parte, in realtà è il cuore, dell'ebuild quickswitch mi pare se ne sia parlato qualche post fa riguardo a piccoli ma utilissimi software ... forse le storie con la tipa ti hanno distratto :wink:
Please EU, pimp my country!

ICE: /etc/init.d/iptables panic
Top
cerri
Bodhisattva
Bodhisattva
User avatar
Posts: 2957
Joined: Wed Mar 05, 2003 5:36 am
Location: # init S
Contact:
Contact cerri
Website

  • Quote

Post by cerri » Tue Apr 29, 2003 3:25 pm

...che le storie con la tipa mi abbiamo distratto si, ma che l'eseguibile switchto facesse parte di quickswitch (mai provato, mi basta dhcpcd :)) non lo sapevo... come potevo!?!?!? :D
Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito
Top
bsolar
Bodhisattva
Bodhisattva
User avatar
Posts: 2764
Joined: Sun Jan 12, 2003 5:14 pm

  • Quote

Post by bsolar » Tue Apr 29, 2003 4:08 pm

mrfree wrote:
switchto
fa parte, in realtà è il cuore, dell'ebuild quickswitch mi pare se ne sia parlato qualche post fa riguardo a piccoli ma utilissimi software ...
Parli di questo messaggio immagino... :wink:
I may not agree with what you say, but I'll defend to the death your right to say it.
Top
cerri
Bodhisattva
Bodhisattva
User avatar
Posts: 2957
Joined: Wed Mar 05, 2003 5:36 am
Location: # init S
Contact:
Contact cerri
Website

  • Quote

Post by cerri » Tue Apr 29, 2003 6:31 pm

bsolar wrote:Parli di questo messaggio immagino... :wink:
Sicuramente... ma tra quickswitch e switchto ce ne corre... ;)
Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito
Top
Ginko
Guru
Guru
User avatar
Posts: 371
Joined: Wed May 01, 2002 9:03 am
Location: nearby my linux laptop
Contact:
Contact Ginko
Website

Re: Utile (forse) script per chi usa il portatile

  • Quote

Post by Ginko » Wed Apr 30, 2003 8:56 am

mrfree wrote:Consiglio a tutti quelli che come me hanno bisogno di switchare diverse configurazioni, presumibilmente su un portatile e principalmente in base al giorno della settimana ... questo semplice init script [..]
Io uso qualcosa di molto simile, in piu' pero', dovendo visitare diversi clienti e portandomi sempre il laptop appresso, ho la necessita' di scegliere il profile all'avvio.
E lo faccio mediante l'append
  • prof=<profile>
in lilo.conf. Esempio :

Code: Select all

[..]
prompt
timeout=50
default=auto
image=/boot/gentoo-2.4.19-r9_new
        label=auto
        read-only
        root=/dev/hda7
        append="prof=auto"
image=/boot/gentoo-2.4.19-r9_new
        label=customer1
        read-only
        root=/dev/hda7
        append="prof=customer1"
image=/boot/gentoo-2.4.19-r9_new
        label=customer2
        read-only
        root=/dev/hda7
        append="prof=customer2"
image=/boot/gentoo-2.4.19-r9_new
        label=casa
        read-only
        root=/dev/hda7
        append="prof=casa"
Il profilo scelto me lo ritrovo poi in /proc/cmdline che posso leggere da uno
start-up script simile al tuo. In effetti il profilo auto fa esattamente quello che fai tu verificando che giorno e' :-)

Saluti
--Gianluca
Top
poisson
n00b
n00b
User avatar
Posts: 35
Joined: Sun Nov 24, 2002 2:13 pm

Re: Utile (forse) script per chi usa il portatile

  • Quote

Post by poisson » Fri May 02, 2003 10:52 pm

Gianluca Rotoni wrote:Il profilo scelto me lo ritrovo poi in /proc/cmdline che posso leggere da uno
start-up script simile al tuo. In effetti il profilo auto fa esattamente quello che fai tu verificando che giorno e' :-)
L'utilizzo dell'append e' ancora piu' semplice:

Code: Select all

append="prof=blabla"
altro non fa che assegnare "blabla" alla variabile d'ambiente "prof", disponibile in tutti gli script di boot.

Ciao !!
Top
maur8
Apprentice
Apprentice
User avatar
Posts: 229
Joined: Tue Mar 04, 2003 11:51 am
Location: Pescara (in serie B!!!), Italy
Contact:
Contact maur8
Website

  • Quote

Post by maur8 » Sat May 03, 2003 5:05 pm

Mitico quickswitch e grande mrfree!
Saluti da Fabrizio 8O
Maur8.
"They decided our fate in a microsecond. Extermination"
Sgt. Kyle Rise, The Terminator
Top
Post Reply
  • Print view

9 posts • Page 1 of 1

Return to “Forum italiano (Italian)”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic