Ignore:
Timestamp:
11/21/09 12:58:51 (3 years ago)
Author:
tschmitt
Message:
  • Linbofs:
    • linbo_cmd.sh, start(): das Beenden der ctorrent-Prozesse wurde an eine frühere Stelle im Startablauf verschoben.
    • init.sh: o neuer Parameter autostart=<int>

autostart=0 unterdrückt generally jegliche Autostart-Definition in der start.conf,
autostart=<nr> setzt den Autostart für das OS an Position <nr> in der start.conf.
Autostarteinträge für andere OS werden unterdrückt.

  • Serverskripte:
    • rsync-post.sh: die Zeit für hochgeladene Image- und Torrent-Dateien wird per touch-Befehl auf die Serverzeit gesetzt, andernfalls verweigert Bittorrent den Dienst, falls die hochgeladenen Dateien eine Erstellungszeit in der Zukunft haben.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/linuxmuster-linbo/branches/testing/linbo/init.sh

    r530 r580  
    4040# Utilities 
    4141 
     42# test if variable is an integer 
     43isinteger () { 
     44 [ $# -eq 1 ] || return 1 
     45 case $1 in 
     46 *[!0-9]*|"") return 1;; 
     47           *) return 0;; 
     48 esac 
     49} 
     50 
    4251# DMA 
    4352enable_dma(){ 
     
    301310 fi 
    302311 echo "$RET" 
     312} 
     313 
     314# handle autostart from cmdline 
     315set_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 
    303344} 
    304345 
     
    354395 # modify cache in start.conf if cache was given and no extra start.conf was defined 
    355396 [ -z "$extra" -a -b "$cache" ] && modify_cache /start.conf 
     397 # set autostart if given on cmdline 
     398 isinteger "$autostart" && set_autostart 
    356399 # remove reboot flag 
    357400 rmlinboreboot 
Note: See TracChangeset for help on using the changeset viewer.