bugfix in bash script to reset system