rolan900d
|
2010-02-21
, 17:35
|
Posts: 527 |
Thanked: 121 times |
Joined on Feb 2010
|
#121
|
|
2010-02-21
, 18:29
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#122
|
|
2010-02-21
, 18:51
|
|
Posts: 1,090 |
Thanked: 476 times |
Joined on Jan 2010
@ Ingolstadt, Germany
|
#123
|
#!/bin/bash # determine number of files in /dconfs cd /etc/hildon-welcome.d/dconfs/ nof=$(ls *.conf | wc -l) # get random number rn=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ") # in range of 1 - nof let "rr = $rn % $nof + 1" # choose random conf rf="$rr.conf" echo "$rr.conf" # copy it over to default.conf cp $rf ../default.conf # exit exit 0
start on starting shutdown script cd /etc/hildon-welcome.d/dconfs/ if [ -f 1.conf ]; then # check which file is currently used if [ -f *.lock ]; then cuf=$(ls *.lock) ruf=$cuf rm *.lock else cuf="1.lock" ruf=$cuf fi # determine number of files in /dconfs nof=$(ls *.conf | wc -l) while [ "$ruf" = "$cuf" ]; do # get "random" number lol rn=$(date +%s) # in range of 1 - nof let "rr = $rn % $nof + 1" # choose random conf ruf="$rr.lock" rf="$rr.conf" done # set file for checking which file is in use rb="$rr.lock" # copy it over to default.conf cp $rf ../default.conf touch $rb fi end script
|
2010-02-21
, 21:41
|
|
Posts: 1,090 |
Thanked: 476 times |
Joined on Jan 2010
@ Ingolstadt, Germany
|
#124
|
|
2010-02-21
, 23:57
|
Posts: 527 |
Thanked: 121 times |
Joined on Feb 2010
|
#125
|
|
2010-02-22
, 04:10
|
|
Posts: 1,090 |
Thanked: 476 times |
Joined on Jan 2010
@ Ingolstadt, Germany
|
#126
|