PKGBUILD-networking.install 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. ## arg 1: the new package version
  3. post_install() {
  4. # Create NetworkManager configuration if we do not have it
  5. if ! [ -e /etc/NetworkManager/NetworkManager.conf ]; then
  6. echo '[main]' > /etc/NetworkManager/NetworkManager.conf
  7. echo 'plugins = keyfile' >> /etc/NetworkManager/NetworkManager.conf
  8. echo '[keyfile]' >> /etc/NetworkManager/NetworkManager.conf
  9. fi
  10. # Remove ip_forward setting from sysctl, so NM will not reset it
  11. # Archlinux now use sysctl.d/ instead of sysctl.conf
  12. #sed 's/^net.ipv4.ip_forward.*/#\0/' -i /etc/sysctl.conf
  13. /usr/lib/qubes/qubes-fix-nm-conf.sh
  14. # Yum proxy configuration is fedora specific
  15. #if ! grep -q '/etc/yum\.conf\.d/qubes-proxy\.conf' /etc/yum.conf; then
  16. # echo >> /etc/yum.conf
  17. # echo '# Yum does not support inclusion of config dir...' >> /etc/yum.conf
  18. # echo 'include=file:///etc/yum.conf.d/qubes-proxy.conf' >> /etc/yum.conf
  19. #fi
  20. for srv in qubes-firewall.service qubes-iptables.service qubes-network.service qubes-updates-proxy.service ; do
  21. systemctl enable $srv
  22. done
  23. }
  24. ## arg 1: the new package version
  25. ## arg 2: the old package version
  26. post_upgrade() {
  27. post_install
  28. }
  29. ## arg 1: the old package version
  30. post_remove() {
  31. for srv in qubes-firewall.service qubes-iptables.service qubes-network.service qubes-updates-proxy.service ; do
  32. systemctl disable $srv
  33. done
  34. }