Scripts to automating daily tasks http://gitea.open6hosting.com/Open6Hosting/smartos-bin
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

47 líneas
828 B

  1. #!/usr/bin/bash
  2. usage()
  3. {
  4. echo "Usage: $0 [ -d dirname ]" >&2
  5. echo "ex: $0 -d /zones/boot/boot-20220113T011608Z"
  6. exit 1
  7. }
  8. while getopts ":d:" opt;
  9. do
  10. case "$opt" in
  11. d)
  12. DIR=$OPTARG
  13. ;;
  14. \?)
  15. echo "Error: Invalid Option: -${OPTARG}" >&2
  16. usage
  17. ;;
  18. :)
  19. echo "Error: -${OPTARG} requires an argument."
  20. usage
  21. ;;
  22. *)
  23. usage
  24. ;;
  25. esac
  26. done
  27. shift $((OPTIND -1 ))
  28. if [ -z ${DIR} ]; then
  29. usage
  30. fi
  31. mkdir -p $DIR/bootfs/etc
  32. cp /etc/system $DIR/bootfs/etc/
  33. echo 'set ngroups_max=1024' >> $DIR/bootfs/etc/system
  34. cat << EOF >> $DIR/loader.conf.local
  35. etc_system_load=YES
  36. etc_system_type=file
  37. etc_system_name=/boot/bootfs/etc/system
  38. etc_system_flags="name=/etc/system"
  39. EOF