Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. base_dir="."
  4. host="$1"
  5. instances_dir="${base_dir}/etc/hab/instances.d"
  6. controls_file="${base_dir}/${host}_controls.txt"
  7.  
  8.  
  9. host_dir="${instances_dir}/${host}"
  10.  
  11. echo
  12. echo "Creating controls file at ${controls_file} for ${host_dir}"
  13. echo
  14.  
  15. echo ">>>>>>>>>>>>>>>>> START"
  16. for install_file in $(gfind ${host_dir} -type f -printf "%P\n"); do
  17. real_path="${host_dir}/${install_file}"
  18. echo "UPD "$(stat -c %y ${real_path} | cut -d. -f1 | awk '{printf "%s_%s",$1,$2}')" "$(stat -c %s ${real_path})" /${install_file}" |tee -a ${controls_file}
  19. done
  20. echo ">>>>>>>>>>>>>>>>> END"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement