View Single Post
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#21
wuhaha
got it ^^

Code:
#!/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
the new random number generator looks quite ugly but it works (look at the pic at the bottom)
(i only have 2 confs in the dconfs-folder ^^)

maybe i'll try to get it in rc2.d
a shortcut on the desktop (for doing it manually) to this script is done very fast (:
Attached Images
 

Last edited by b666m; 2010-02-18 at 21:28.
 

The Following User Says Thank You to b666m For This Useful Post: