View previous topic :: View next topic |
Author |
Message |
mrfree Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/gallery/Monkey Island/Monkey_Island_-_Guybrush.gif)
Joined: 15 Mar 2003 Posts: 1303 Location: Europe.Italy.Sulmona
|
Posted: Tue Apr 29, 2003 2:54 pm Post subject: Utile (forse) script per chi usa il portatile |
|
|
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: | #!/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 ![Very Happy :D](images/smiles/icon_biggrin.gif) _________________ Please EU, pimp my country!
ICE: /etc/init.d/iptables panic |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cerri Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/7000506493e7cdb5c136c3.jpg)
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Tue Apr 29, 2003 3:16 pm Post subject: |
|
|
? _________________ 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 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mrfree Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/gallery/Monkey Island/Monkey_Island_-_Guybrush.gif)
Joined: 15 Mar 2003 Posts: 1303 Location: Europe.Italy.Sulmona
|
Posted: Tue Apr 29, 2003 3:24 pm Post subject: |
|
|
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 :wink:](images/smiles/icon_wink.gif) _________________ Please EU, pimp my country!
ICE: /etc/init.d/iptables panic |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cerri Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/7000506493e7cdb5c136c3.jpg)
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Tue Apr 29, 2003 3:25 pm Post subject: |
|
|
...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!?!?!? ![Very Happy :D](images/smiles/icon_biggrin.gif) _________________ 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 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
bsolar Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/806967053f23f4aede2da.jpg)
Joined: 12 Jan 2003 Posts: 2764
|
Posted: Tue Apr 29, 2003 4:08 pm Post subject: |
|
|
mrfree wrote: |
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 :wink:](images/smiles/icon_wink.gif) _________________ I may not agree with what you say, but I'll defend to the death your right to say it. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cerri Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/7000506493e7cdb5c136c3.jpg)
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Tue Apr 29, 2003 6:31 pm Post subject: |
|
|
Sicuramente... ma tra quickswitch e switchto ce ne corre... ![Wink ;)](images/smiles/icon_wink.gif) _________________ 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 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Ginko Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/10943389714088c08ad7803.gif)
Joined: 01 May 2002 Posts: 371 Location: nearby my linux laptop
|
Posted: Wed Apr 30, 2003 8:56 am Post subject: Re: Utile (forse) script per chi usa il portatile |
|
|
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 in lilo.conf. Esempio : Code: | [..]
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 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
poisson n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/15881195463eb302ff2f6cf.jpg)
Joined: 24 Nov 2002 Posts: 35
|
Posted: Fri May 02, 2003 10:52 pm Post subject: Re: Utile (forse) script per chi usa il portatile |
|
|
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: | append="prof=blabla" | altro non fa che assegnare "blabla" alla variabile d'ambiente "prof", disponibile in tutti gli script di boot.
Ciao !! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
maur8 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/StarCraft/starcraft_terran_marine.gif)
Joined: 04 Mar 2003 Posts: 229 Location: Pescara (in serie B!!!), Italy
|
Posted: Sat May 03, 2003 5:05 pm Post subject: |
|
|
Mitico quickswitch e grande mrfree!
Saluti da Fabrizio ![Shocked 8O](images/smiles/icon_eek.gif) _________________ Maur8.
"They decided our fate in a microsecond. Extermination"
Sgt. Kyle Rise, The Terminator |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|