cookutils rev 764

cooker: restore previous $command
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Oct 10 12:59:57 2015 +0200 (2015-10-10)
parents 30afd82dffb7
children 55614babc99a
files cooker
line diff
     1.1 --- a/cooker	Sat Oct 10 12:40:48 2015 +0200
     1.2 +++ b/cooker	Sat Oct 10 12:59:57 2015 +0200
     1.3 @@ -58,6 +58,8 @@
     1.4  
     1.5  clean_exit() {
     1.6  	rm -f $command; touch $command
     1.7 +	ps | grep -q "${previous_command/:/ }" &&
     1.8 +	echo "$previous_command" > $command
     1.9  	rm -f $pidfile
    1.10  }
    1.11  
    1.12 @@ -248,6 +250,7 @@
    1.13  # Commands
    1.14  #
    1.15  
    1.16 +previous_command="$(cat $command)"
    1.17  case "$1" in
    1.18  	usage|help|-u|-h)
    1.19  		usage ;;