core-agent-linux/vm-systemd/misc-post.sh

51 lines
1.8 KiB
Bash
Raw Normal View History

#!/bin/sh
if [ -f /var/run/qubes-service/yum-proxy-setup -o -f /var/run/qubes-service/updates-proxy-setup ]; then
if [ -d /etc/apt/apt.conf.d ]; then
2014-10-24 00:45:39 +02:00
echo 'Acquire::http::Proxy "http://10.137.255.254:8082/";' >> /etc/apt/apt.conf.d/01qubes-proxy
fi
if [ -d /etc/yum.conf.d ]; then
echo proxy=http://10.137.255.254:8082/ > /etc/yum.conf.d/qubes-proxy.conf
fi
else
if [ -d /etc/apt/apt.conf.d ]; then
rm -f /etc/apt/apt.conf.d/01qubes-proxy
fi
if [ -d /etc/yum.conf.d ]; then
echo > /etc/yum.conf.d/qubes-proxy.conf
fi
fi
# Set IP address again (besides action in udev rules); this is needed by
# DispVM (to override DispVM-template IP) and in case when qubes-ip was
# called by udev before loading evtchn kernel module - in which case
2013-06-07 05:20:55 +02:00
# qubesdb-read fails
INTERFACE=eth0 /usr/lib/qubes/setup-ip
[ -x /rw/config/rc.local ] && /rw/config/rc.local
# Start services which haven't own proper systemd unit:
# Start AppVM specific services
INSTALL_CMD='/usr/bin/qubes-desktop-file-install --force --dir /var/lib/qubes/xdg/autostart'
qubes-desktop-file-install: Manages xdg desktop entry files qubes-desktop-file-install is called by qubes-triggers-desktop-file-install. It's arguments are based on the Gnome desktop-install-file utility to allow it to be replaced by same. Currently the Gnome utility can not be used since it automatically validates the .desktop entry files with no option to skip validation and will fail on some third party .desktop files that are not formed properly. A single trigger script is shared between Fedora, Debian. This script is used by the package managers triggers and will copy original .desktop files from `/etc/xdg/autostart` to `/usr/share/qubes/xdg/autostart` and modify the OnlyShownIn / NotShownIn, etc. The original .desktop files are left untouched and left in place. Qubes modifies the XDG_CONFIG_DIRS to first include the `/usr/share/qubes/xdg` directory (XDG_CONFIG_DIRS=/usr/share/qubes/xdg:/etc/xdg). If a package gets removed, it's desktop entry is also removed from the /usr/share/qubes/xdg directory. 'qubes-desktop-file-install' options: --dir DIR Install desktop files to the DIR directory (default: <FILE>) --force Force overwrite of existing desktop files (default: False) --remove-show-in Remove the "OnlyShowIn" and "NotShowIn" entries from the desktop file (default: False) --remove-key KEY Remove the KEY key from the desktop files, if present --set-key (KEY VALUE) Set the KEY key to VALUE --remove-only-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should be displayed --add-only-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should be displayed --remove-not-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should not be displayed --add-not-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should not be displayed
2015-08-02 23:30:26 +02:00
if [ ! -f /etc/systemd/system/cups.service ]; then
if [ -f /var/run/qubes-service/cups ]; then
/usr/sbin/service cups start
# Allow also notification icon
qubes-desktop-file-install: Manages xdg desktop entry files qubes-desktop-file-install is called by qubes-triggers-desktop-file-install. It's arguments are based on the Gnome desktop-install-file utility to allow it to be replaced by same. Currently the Gnome utility can not be used since it automatically validates the .desktop entry files with no option to skip validation and will fail on some third party .desktop files that are not formed properly. A single trigger script is shared between Fedora, Debian. This script is used by the package managers triggers and will copy original .desktop files from `/etc/xdg/autostart` to `/usr/share/qubes/xdg/autostart` and modify the OnlyShownIn / NotShownIn, etc. The original .desktop files are left untouched and left in place. Qubes modifies the XDG_CONFIG_DIRS to first include the `/usr/share/qubes/xdg` directory (XDG_CONFIG_DIRS=/usr/share/qubes/xdg:/etc/xdg). If a package gets removed, it's desktop entry is also removed from the /usr/share/qubes/xdg directory. 'qubes-desktop-file-install' options: --dir DIR Install desktop files to the DIR directory (default: <FILE>) --force Force overwrite of existing desktop files (default: False) --remove-show-in Remove the "OnlyShowIn" and "NotShowIn" entries from the desktop file (default: False) --remove-key KEY Remove the KEY key from the desktop files, if present --set-key (KEY VALUE) Set the KEY key to VALUE --remove-only-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should be displayed --add-only-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should be displayed --remove-not-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should not be displayed --add-not-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should not be displayed
2015-08-02 23:30:26 +02:00
$INSTALL_CMD --remove-not-show-in X-QUBES /etc/xdg/autostart/print-applet.desktop
else
# Disable notification icon
qubes-desktop-file-install: Manages xdg desktop entry files qubes-desktop-file-install is called by qubes-triggers-desktop-file-install. It's arguments are based on the Gnome desktop-install-file utility to allow it to be replaced by same. Currently the Gnome utility can not be used since it automatically validates the .desktop entry files with no option to skip validation and will fail on some third party .desktop files that are not formed properly. A single trigger script is shared between Fedora, Debian. This script is used by the package managers triggers and will copy original .desktop files from `/etc/xdg/autostart` to `/usr/share/qubes/xdg/autostart` and modify the OnlyShownIn / NotShownIn, etc. The original .desktop files are left untouched and left in place. Qubes modifies the XDG_CONFIG_DIRS to first include the `/usr/share/qubes/xdg` directory (XDG_CONFIG_DIRS=/usr/share/qubes/xdg:/etc/xdg). If a package gets removed, it's desktop entry is also removed from the /usr/share/qubes/xdg directory. 'qubes-desktop-file-install' options: --dir DIR Install desktop files to the DIR directory (default: <FILE>) --force Force overwrite of existing desktop files (default: False) --remove-show-in Remove the "OnlyShowIn" and "NotShowIn" entries from the desktop file (default: False) --remove-key KEY Remove the KEY key from the desktop files, if present --set-key (KEY VALUE) Set the KEY key to VALUE --remove-only-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should be displayed --add-only-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should be displayed --remove-not-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should not be displayed --add-not-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should not be displayed
2015-08-02 23:30:26 +02:00
$INSTALL_CMD --add-not-show-in X-QUBES /etc/xdg/autostart/print-applet.desktop
fi
fi
if [ -f /var/run/qubes-service/network-manager ]; then
# Allow also notification icon
qubes-desktop-file-install: Manages xdg desktop entry files qubes-desktop-file-install is called by qubes-triggers-desktop-file-install. It's arguments are based on the Gnome desktop-install-file utility to allow it to be replaced by same. Currently the Gnome utility can not be used since it automatically validates the .desktop entry files with no option to skip validation and will fail on some third party .desktop files that are not formed properly. A single trigger script is shared between Fedora, Debian. This script is used by the package managers triggers and will copy original .desktop files from `/etc/xdg/autostart` to `/usr/share/qubes/xdg/autostart` and modify the OnlyShownIn / NotShownIn, etc. The original .desktop files are left untouched and left in place. Qubes modifies the XDG_CONFIG_DIRS to first include the `/usr/share/qubes/xdg` directory (XDG_CONFIG_DIRS=/usr/share/qubes/xdg:/etc/xdg). If a package gets removed, it's desktop entry is also removed from the /usr/share/qubes/xdg directory. 'qubes-desktop-file-install' options: --dir DIR Install desktop files to the DIR directory (default: <FILE>) --force Force overwrite of existing desktop files (default: False) --remove-show-in Remove the "OnlyShowIn" and "NotShowIn" entries from the desktop file (default: False) --remove-key KEY Remove the KEY key from the desktop files, if present --set-key (KEY VALUE) Set the KEY key to VALUE --remove-only-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should be displayed --add-only-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should be displayed --remove-not-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should not be displayed --add-not-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should not be displayed
2015-08-02 23:30:26 +02:00
$INSTALL_CMD --remove-not-show-in X-QUBES --add-only-show-in X-QUBES /etc/xdg/autostart/nm-applet.desktop
else
# Disable notification icon
qubes-desktop-file-install: Manages xdg desktop entry files qubes-desktop-file-install is called by qubes-triggers-desktop-file-install. It's arguments are based on the Gnome desktop-install-file utility to allow it to be replaced by same. Currently the Gnome utility can not be used since it automatically validates the .desktop entry files with no option to skip validation and will fail on some third party .desktop files that are not formed properly. A single trigger script is shared between Fedora, Debian. This script is used by the package managers triggers and will copy original .desktop files from `/etc/xdg/autostart` to `/usr/share/qubes/xdg/autostart` and modify the OnlyShownIn / NotShownIn, etc. The original .desktop files are left untouched and left in place. Qubes modifies the XDG_CONFIG_DIRS to first include the `/usr/share/qubes/xdg` directory (XDG_CONFIG_DIRS=/usr/share/qubes/xdg:/etc/xdg). If a package gets removed, it's desktop entry is also removed from the /usr/share/qubes/xdg directory. 'qubes-desktop-file-install' options: --dir DIR Install desktop files to the DIR directory (default: <FILE>) --force Force overwrite of existing desktop files (default: False) --remove-show-in Remove the "OnlyShowIn" and "NotShowIn" entries from the desktop file (default: False) --remove-key KEY Remove the KEY key from the desktop files, if present --set-key (KEY VALUE) Set the KEY key to VALUE --remove-only-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should be displayed --add-only-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should be displayed --remove-not-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should not be displayed --add-not-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should not be displayed
2015-08-02 23:30:26 +02:00
$INSTALL_CMD --remove-only-show-in X-QUBES --add-not-show-in X-QUBES /etc/xdg/autostart/nm-applet.desktop
fi
exit 0