Advertisement
sergio_educacionit

samba.mount.sh

Dec 28th, 2023 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4.  
  5. # Reemplzar el valor de las variables con los paramentros correctos.
  6. # añadir a un cron con privilegios @reboot /path/to/this_script.sh
  7. # Se recomienda que el servicio no inicie con el sistema.
  8.  
  9. service="nmbd.service"
  10. uuid="42e33c38-4d03-4316-9454-f7646be3544d"
  11. mountpoint="/var/samba"
  12.  
  13. # Opcional, descomentar si el servicio se inicia con el sistema.
  14.  
  15. #systemctl stop $service
  16.  
  17.  
  18. mount -U $uuid $mountpoint && systemctl start $service || echo "$(date) - no se pudo montar el dispositivo" >> /var/log/mount.log
  19.  
  20.  
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement