Changeset 580 for main/linuxmuster-linbo/branches/testing/linbo/init.sh
- Timestamp:
- 11/21/09 12:58:51 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/linuxmuster-linbo/branches/testing/linbo/init.sh
r530 r580 40 40 # Utilities 41 41 42 # test if variable is an integer 43 isinteger () { 44 [ $# -eq 1 ] || return 1 45 case $1 in 46 *[!0-9]*|"") return 1;; 47 *) return 0;; 48 esac 49 } 50 42 51 # DMA 43 52 enable_dma(){ … … 301 310 fi 302 311 echo "$RET" 312 } 313 314 # handle autostart from cmdline 315 set_autostart() { 316 # count [OS] entries 317 local counts="$(grep -ci ^"\[OS\]" /start.conf)" 318 # return if autostart value is greater than number of OS entries 319 [ $autostart -gt $counts -o $autostart -lt 0 ] && return 320 # return if autostart shall be suppressed generally 321 if [ "$autostart" = "0" ]; then 322 # set all autostart parameters to no 323 sed -e 's|^[Aa][Uu][Tt][Oo][Ss][Tt][Aa][Rr][Tt].*|Autostart = no|g' -i /start.conf 324 return 325 fi 326 # autostart OS at start.conf position given by autostart parameter 327 local c=0 328 local found=0 329 local line="" 330 while read -r line; do 331 if echo "$line" | grep -qi ^"\[OS\]"; then 332 let c=+1 333 [ "$autostart" = "$c" ] && found=1 334 fi 335 # suppress autostart for other OS entries 336 echo "$line" | grep -qi ^autostart || echo "$line" >> /start.conf.new 337 # write autostart line for specific OS 338 if [ "$found" = "1" ]; then 339 echo "Autostart = yes" >> /start.conf.new 340 found=0 341 fi 342 done </start.conf 343 mv /start.conf.new /start.conf 303 344 } 304 345 … … 354 395 # modify cache in start.conf if cache was given and no extra start.conf was defined 355 396 [ -z "$extra" -a -b "$cache" ] && modify_cache /start.conf 397 # set autostart if given on cmdline 398 isinteger "$autostart" && set_autostart 356 399 # remove reboot flag 357 400 rmlinboreboot
Note: See TracChangeset
for help on using the changeset viewer.
