#!/bin/bash
#####################################################################################################
# Script_Name : xrdp-installer-1.3.sh
# Description : Perform xRDP installation on Ubuntu 18.04,20.4,20.10,21.04 and perform
# additional post configuration to improve end user experience
# Date : October 2021
# written by : Griffon
# WebSite :http://www.c-nergy.be - http://www.c-nergy.be/blog
# Version : 1.3
# History : 1.3 - Adding support for Ubuntu 21.10 (STR)
# - Code modification sound redirection using meson technology (ubuntu 21.10 only so far)
# - Adding code to copy config.h file which seems to be missing from xrdp-pulseaudio modules
# - Adding support for Debian (10 and 11) (Best Effort)
# - Commenting out installation of Gnome Tweaks. Tweaks is not installed anymore by default
# - Added Rules to Detect Budgie-Desktop and postConfig settings
# - Added support for Pop!_0S (Best Effort !!!)
# - Code Changes to detect Desktop Interface in use
# - Reworked code for xrdp removal option
# - Improved Std vs Custom installation detection process
# - Added support for Different Desktop Interfaces (More testing needed)
# - General Code structure re-worked to add more OS version and Desktop interface support
# - Fixed Minor Bug(s)
# : 1.2.3 - Adding support for Ubuntu 21.04
# - Removing Support for Ubuntu 16.04.x (End Standard Support)
# - Delete xrdp and xorgxrdp folder when remove option selected
# - Review remove function to detect hwe package U18.04
# - Review, Optimize, Cleanup Code
# : 1.2.2 - Changing Ubuntu repository from be.archive.ubuntu.com to archive.ubuntu.com
# - Bug Fixing - /etc/xrdp/xrdp-installer-check.log not deleted when remove option
# selected in the script - Force Deletion (Thanks to Hiero for this input)
# - Bug Fixing - Grab automatically xrdp/xorgxrdp package version to avoid
# issues when upgrade operation performed (Thanks to Hiero for this input)
# : 1.2.1 - Adding Support to Ubuntu 20.10 + Removed support for Ubuntu 19.10
# 1.2 - Adding Support to Ubuntu 20.04 + Removed support for Ubuntu 19.04
# - Stricter Check for HWE Package (thanks to Andrej Gantvorg)
# - Changed code in checking where to copy image for login screen customization
# - Fixed Bug checking SSL group membership
# - Updating background color xrdp login screen
# - Updating pkgversion to x.13 for checkinstall process
# : 1.1 - Tackling multiple run of the script
# - Improved checkinstall method/check ssl group memberhsip
# - Replaced ~/Downloads by a variable
# : 1.0 - Added remove option + Final optimization
# : 0.9 - updated compile section to use checkinstall
# : 0.8 - Updated the fix_theme function to add support for Ubuntu 16.04
# : 0.7 - Updated prereqs function to add support for Ubuntu 16.04
# : 0.6 - Adding logic to detect Ubuntu version for U16.04
# : 0.5 - Adding env variable Fix
# : 0.4 - Adding SSL Fix
# : 0.3 - Adding custom login screen option
# : 0.2 - Adding new code for passing parameters
# : 0.1 - Initial Script (merging custom & Std)
# Disclaimer : Script provided AS IS. Use it at your own risk....
# You can use this script and distribute it as long as credits are kept
# in place and unchanged
####################################################################################################
#---------------------------------------------------#
# Variables and Constants #
#---------------------------------------------------#
#--Automating Script versioning
ScriptVer="1.3"
#--Detecting OS Version
version=$(lsb_release -sd)
codename=$(lsb_release -sc)
Release=$(lsb_release -sr)
#--Detecting variable related to Desktop interface and Directory path
DesktopVer="$XDG_CURRENT_DESKTOP"
SessionVer="$GNOME_SHELL_SESSION_MODE"
ConfDir="$XDG_DATA_DIRS"
#Define Dwnload variable to point to ~/Downloads folder of user running the script
Dwnload=$(xdg-user-dir DOWNLOAD)
#Initialzing other variables
modetype="unknown"
#--------------------------------------------------------------------------#
# -----------------------Function Section - DO NOT MODIFY -----------------#
#--------------------------------------------------------------------------#
#---------------------------------------------------#
# Function 0 - check for supported OS version ....#
#---------------------------------------------------#
check_os()
{
echo
/bin/echo -e "\e[1;33m |-| Detecting OS version \e[0m"
case $version in
*"Ubuntu 18.04"*)
/bin/echo -e "\e[1;32m |-| OS Version : $version\e[0m"
/bin/echo -e "\e[1;32m |-| Desktop Version : $DesktopVer\e[0m"
;;
*"Ubuntu 20.04"*)
/bin/echo -e "\e[1;32m |-| OS Version : $version\e[0m"
/bin/echo -e "\e[1;32m |-| Desktop Version : $DesktopVer\e[0m"
;;
*"Ubuntu 21.04"*)
/bin/echo -e "\e[1;32m |-| OS Version : $version\e[0m"
/bin/echo -e "\e[1;32m |-| Desktop Version : $DesktopVer\e[0m"
;;
*"Ubuntu 21.10"*)
/bin/echo -e "\e[1;32m |-| OS Version : $version\e[0m"
/bin/echo -e "\e[1;32m |-| Desktop Version : $DesktopVer\e[0m"
;;
*"Pop!_OS 20.04"*)
/bin/echo -e "\e[1;32m |-| OS Version : $version\e[0m"
/bin/echo -e "\e[1;32m |-| Desktop Version : $DesktopVer\e[0m"
;;
*"Pop!_OS 21.04"*)
/bin/echo -e "\e[1;32m |-| OS Version : $version\e[0m"
/bin/echo -e "\e[1;32m |-| Desktop Version : $DesktopVer\e[0m"
;;
*"Debian"*)
/bin/echo -e "\e[1;32m |-| OS Version : $version\e[0m"
/bin/echo -e "\e[1;32m |-| Desktop Version : $DesktopVer\e[0m"
if [[ $Release="11" ]]
then
zenity --info --text="You are running Debian 11. Please note that standard mode will not allow you to perform remote connection against Gnome Desktop. This is a known Debian/xrdp issue. Use custom install mode" --width=500
#exit
fi
;;
*)
/bin/echo -e "\e[1;31m !--------------------------------------------------------------!\e[0m"
/bin/echo -e "\e[1;31m ! Your system is not running a supported version ! !\e[0m"
/bin/echo -e "\e[1;31m ! The script has been tested only on the following versions !\e[0m"
/bin/echo -e "\e[1;31m ! 18.04.x/20.04.x/21.04/21.10/Debian 10/Pop!_OS !\e[0m"
/bin/echo -e "\e[1;31m ! The script is exiting... !\e[0m"
/bin/echo -e "\e[1;31m !--------------------------------------------------------------!\e[0m"
echo
exit
;;
esac
echo
}
#---------------------------------------------------#
# Function 1 - check xserver-xorg-core package....
#---------------------------------------------------#
check_hwe()
{
Release=$(lsb_release -sr)
echo
/bin/echo -e "\e[1;33m |-| Detecting xserver-xorg-core package installed \e[0m"
xorg_no_hwe_install_status=$(dpkg-query -W -f ='${Status}\n' xserver-xorg-core 2>/dev/null)
xorg_hwe_install_status=$(dpkg-query -W -f ='${Status}\n' xserver-xorg-core-hwe-$Release 2>/dev/null)
if [[ "$xorg_hwe_install_status" =~ \ installed$ ]]
then
# – hwe version is installed on the system
/bin/echo -e "\e[1;32m |-| xorg package version: xserver-xorg-core-hwe \e[0m"
HWE="yes"
elif [[ "$xorg_no_hwe_install_status" =~ \ installed$ ]]
then
/bin/echo -e "\e[1;32m |-| xorg package version: xserver-x
xrdp-installer-1.3
需积分: 0 190 浏览量
2023-04-06
14:02:01
上传
评论
收藏 8KB ZIP 举报
Dinh_ding
- 粉丝: 9
- 资源: 2
最新资源
- JavaScript《基于自动分析数据并给出营业建议的餐厅管理系统(接入AI) 》+源代码+项目说明及资料
- 355670834783295707ad04e-427f-4cde-9589-e578224a8459.zip
- 动态sql解析引擎,类似mybatis动态sql的功能
- EDA365-Skill-V2.5安装包,支持Allegro17.x版本
- C# 常用单词汇总,常用单词汇总
- 【ERP标准流程-标准流程-库内业务管理】(DOC 14页).doc
- Python《数据库期末作业-餐厅点单系统 》+源代码+设计资料
- 学生成绩管理系统(C++课程设计
- 双指针法判断链表有环-go语言实现
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈