Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # To link:
  4. # chmod +x link.sh
  5. # sudo ./link.sh
  6.  
  7. my_etc=$HOME/myconfig/Y540/etc
  8.  
  9. files=(
  10. modprobe.d/blacklist.conf
  11. # X11/xorg.conf.d/50-touchpad.conf
  12. # X11/xorg.conf.d/60-keyboard.conf
  13. # X11/xorg.conf.d/90-nvidia.conf
  14. )
  15.  
  16. for file in "${files[@]}"
  17. do
  18. source=$my_etc/$file
  19. target=/etc/$file
  20.  
  21. echo Unlinking "$target" ...
  22. ln -sf -- "$source" "$target"
  23. # unlink "$target"
  24.  
  25. echo Linking "$source" to "$target"
  26. ln -s "$source" "$target"
  27. done
  28.  
  29.  
  30. YIELDS:
  31.  
  32. [milos@milos etc]$ sudo ./link.sh
  33. Unlinking /etc/modprobe.d/blacklist.conf ...
  34. Linking /root/myconfig/Y540/etc/modprobe.d/blacklist.conf to /etc/modprobe.d/blacklist.conf
  35. ln: failed to create symbolic link '/etc/modprobe.d/blacklist.conf': File exists
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement