misc-post.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/sh
  2. if [ -f /var/run/qubes-service/yum-proxy-setup -o -f /var/run/qubes-service/updates-proxy-setup ]; then
  3. if [ -d /etc/apt/apt.conf.d ]; then
  4. echo 'Acquire::http::Proxy "http://10.137.255.254:8082/";' >> /etc/apt/apt.conf.d/01qubes-proxy
  5. fi
  6. if [ -d /etc/yum.conf.d ]; then
  7. echo proxy=http://10.137.255.254:8082/ > /etc/yum.conf.d/qubes-proxy.conf
  8. fi
  9. else
  10. if [ -d /etc/apt/apt.conf.d ]; then
  11. rm -f /etc/apt/apt.conf.d/01qubes-proxy
  12. fi
  13. if [ -d /etc/yum.conf.d ]; then
  14. echo > /etc/yum.conf.d/qubes-proxy.conf
  15. fi
  16. fi
  17. # Set IP address again (besides action in udev rules); this is needed by
  18. # DispVM (to override DispVM-template IP) and in case when qubes-ip was
  19. # called by udev before loading evtchn kernel module - in which case
  20. # qubesdb-read fails
  21. INTERFACE=eth0 /usr/lib/qubes/setup-ip
  22. [ -x /rw/config/rc.local ] && /rw/config/rc.local
  23. # Start services which haven't own proper systemd unit:
  24. # Start AppVM specific services
  25. if [ ! -f /etc/systemd/system/cups.service ]; then
  26. if [ -f /var/run/qubes-service/cups ]; then
  27. /usr/sbin/service cups start
  28. # Allow also notification icon
  29. sed -i -e '/^NotShowIn=.*QUBES/s/;QUBES//' /etc/xdg/autostart/print-applet.desktop
  30. else
  31. # Disable notification icon
  32. sed -i -e '/QUBES/!s/^NotShowIn=\(.*\)/NotShowIn=QUBES;\1/' /etc/xdg/autostart/print-applet.desktop
  33. fi
  34. fi
  35. if [ -f /var/run/qubes-service/network-manager ]; then
  36. # Allow also notification icon
  37. sed -i -e '/QUBES/!s/^OnlyShowIn=.*/\0QUBES;/' /etc/xdg/autostart/nm-applet.desktop
  38. sed -i -e '/^NotShowIn=.*/s/QUBES;//' /etc/xdg/autostart/nm-applet.desktop
  39. else
  40. # Disable notification icon
  41. sed -i -e '/^OnlyShowIn=.*/s/QUBES;//' /etc/xdg/autostart/nm-applet.desktop
  42. sed -i -e '/QUBES/!s/^NotShowIn=.*/\0QUBES;/' /etc/xdg/autostart/nm-applet.desktop
  43. fi
  44. exit 0