1
0
forked from mir/linux-vm-tools

Merge pull request #66 from luizbills/patch-1

Fix bash code style
This commit is contained in:
Justin 2018-10-17 09:43:23 -07:00 committed by GitHub
commit 0b13ac2924
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 16 deletions

View File

@ -6,7 +6,7 @@
# The configuration is adapted from the Ubuntu 16.04 script. # The configuration is adapted from the Ubuntu 16.04 script.
# #
if [ $(id -u) -ne 0 ] ; then if [ $(id -u) -ne 0 ]; then
echo 'This script must be run with root privileges' >&2 echo 'This script must be run with root privileges' >&2
exit 1 exit 1
fi fi
@ -51,12 +51,12 @@ echo "allowed_users=anybody" > /etc/X11/Xwrapper.config
#Ensure hv_sock gets loaded #Ensure hv_sock gets loaded
if [ ! -e /etc/modules-load.d/hv_sock.conf ] ; then if [ ! -e /etc/modules-load.d/hv_sock.conf ]; then
echo "hv_sock" > /etc/modules-load.d/hv_sock.conf echo "hv_sock" > /etc/modules-load.d/hv_sock.conf
fi fi
# Configure the policy xrdp session # Configure the policy xrdp session
cat >/etc/polkit-1/rules.d/02-allow-colord.rules <<EOF cat > /etc/polkit-1/rules.d/02-allow-colord.rules <<EOF
polkit.addRule(function(action, subject) { polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.color-manager.create-device" || if ((action.id == "org.freedesktop.color-manager.create-device" ||
action.id == "org.freedesktop.color-manager.modify-profile" || action.id == "org.freedesktop.color-manager.modify-profile" ||
@ -72,7 +72,7 @@ polkit.addRule(function(action, subject) {
EOF EOF
# Adapt the xrdp pam config # Adapt the xrdp pam config
cat >/etc/pam.d/xrdp-sesman <<EOF cat > /etc/pam.d/xrdp-sesman <<EOF
#%PAM-1.0 #%PAM-1.0
auth include system-remote-login auth include system-remote-login
account include system-remote-login account include system-remote-login

View File

@ -1,9 +1,10 @@
#!/bin/bash #!/bin/bash
# #
# This script is for Arch Linux to download and install XRDP+XORGXRDP # This script is for Arch Linux to download and install XRDP+XORGXRDP
# #
if [ $(id -u) -eq 0 ] ; then if [ $(id -u) -eq 0 ]; then
echo 'This script must be run as a non-root user, as building packages as root is unsupported.' >&2 echo 'This script must be run as a non-root user, as building packages as root is unsupported.' >&2
exit 1 exit 1
fi fi

View File

@ -1,4 +1,4 @@
#! /bin/bash #!/bin/bash
# #
# This script configures the logged in users xsession to properly # This script configures the logged in users xsession to properly
@ -7,12 +7,12 @@
# Major thanks to: http://c-nergy.be/blog/?p=10752 for the tips. # Major thanks to: http://c-nergy.be/blog/?p=10752 for the tips.
# #
if [ ! $(id -u) ] ; then if [ ! $(id -u) ]; then
echo 'This script must be run with root privileges' >&2 echo 'This script must be run with root privileges' >&2
exit 1 exit 1
fi fi
bash -c "cat >~/.xsession <<EOF bash -c "cat > ~/.xsession <<EOF
/usr/lib/gnome-session/gnome-session-binary --session=ubuntu & /usr/lib/gnome-session/gnome-session-binary --session=ubuntu &
/usr/lib/x86_64-linux-gnu/unity/unity-panel-service & /usr/lib/x86_64-linux-gnu/unity/unity-panel-service &
@ -26,4 +26,4 @@ do
\\\${service} & \\\${service} &
done done
unity unity
EOF" EOF"

View File

@ -11,7 +11,7 @@
# Update our machine to the latest code if we need to. # Update our machine to the latest code if we need to.
# #
if [ $(id -u) -ne 0 ] ; then if [ $(id -u) -ne 0 ]; then
echo 'This script must be run with root privileges' >&2 echo 'This script must be run with root privileges' >&2
exit 1 exit 1
fi fi
@ -83,7 +83,7 @@ systemctl enable xrdp.service
systemctl enable xrdp-sesman.service systemctl enable xrdp-sesman.service
# Configure the policy xrdp session # Configure the policy xrdp session
bash -c 'cat >/etc/polkit-1/localauthority.conf.d/02-allow-colord.conf <<EOF bash -c 'cat > /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf <<EOF
polkit.addRule(function(action, subject) { polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.color-manager.create-device" || if ((action.id == "org.freedesktop.color-manager.create-device" ||

View File

@ -11,7 +11,7 @@
# Update our machine to the latest code if we need to. # Update our machine to the latest code if we need to.
# #
if [ $(id -u) -ne 0 ] ; then if [ $(id -u) -ne 0 ]; then
echo 'This script must be run with root privileges' >&2 echo 'This script must be run with root privileges' >&2
exit 1 exit 1
fi fi
@ -49,7 +49,7 @@ sed -i_orig -e 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini
sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini
# Add script to setup the ubuntu session properly # Add script to setup the ubuntu session properly
if [ ! -e /etc/xrdp/startubuntu.sh ] ; then if [ ! -e /etc/xrdp/startubuntu.sh ]; then
cat >> /etc/xrdp/startubuntu.sh << EOF cat >> /etc/xrdp/startubuntu.sh << EOF
#!/bin/sh #!/bin/sh
export GNOME_SHELL_SESSION_MODE=ubuntu export GNOME_SHELL_SESSION_MODE=ubuntu
@ -69,19 +69,19 @@ sed -i -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc
sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
# Blacklist the vmw module # Blacklist the vmw module
if [ ! -e /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf ] ; then if [ ! -e /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf ]; then
cat >> /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf <<EOF cat >> /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf <<EOF
blacklist vmw_vsock_vmci_transport blacklist vmw_vsock_vmci_transport
EOF EOF
fi fi
#Ensure hv_sock gets loaded #Ensure hv_sock gets loaded
if [ ! -e /etc/modules-load.d/hv_sock.conf ] ; then if [ ! -e /etc/modules-load.d/hv_sock.conf ]; then
echo "hv_sock" > /etc/modules-load.d/hv_sock.conf echo "hv_sock" > /etc/modules-load.d/hv_sock.conf
fi fi
# Configure the policy xrdp session # Configure the policy xrdp session
cat >/etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla <<EOF cat > /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla <<EOF
[Allow Colord all Users] [Allow Colord all Users]
Identity=unix-user:* Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile