Fix : Refactor Gnome RDP a bit.
This commit is contained in:
parent
8d8b0013ca
commit
51eb7a6092
|
@ -24,13 +24,13 @@ function fix_gradle_lock() {
|
|||
}
|
||||
|
||||
# Fix Gnome's broken RDP ffs.
|
||||
# Usage: fix_gnome_rdp <USER> <PASSWORD>
|
||||
# Usage: fix_gnome_rdp <PASSWORD>
|
||||
function fix_gnome_rdp() {
|
||||
local user="${1}"
|
||||
local password="${2}"
|
||||
local user="${USERNAME}"
|
||||
local password="${1}"
|
||||
|
||||
# Check params.
|
||||
if [[ "${user}" = "" ]] || [[ "${password}" = "" ]]; then
|
||||
if [[ "${password}" = "" ]]; then
|
||||
help fix_gnome_rdp
|
||||
return 2
|
||||
fi
|
||||
|
@ -43,12 +43,12 @@ function fix_gnome_rdp() {
|
|||
cd /tmp
|
||||
openssl genrsa -out rdp-tls.key 4096
|
||||
openssl req -new -key rdp-tls.key -subj "/C=US" | openssl x509 -req -days 730 -signkey rdp-tls.key -out rdp-tls.crt
|
||||
mkdir -p /home/"${user}"/.local/share/gnome-remote-desktop/
|
||||
mv rdp-tls.key rdp-tls.crt /home/"${user}"/.local/share/gnome-remote-desktop/
|
||||
mkdir -p "${HOME}/.local/share/gnome-remote-desktop/"
|
||||
mv rdp-tls.key rdp-tls.crt "${HOME}/.local/share/gnome-remote-desktop/"
|
||||
|
||||
# Configure RDP.
|
||||
grdctl rdp set-tls-cert /home/"${user}"/.local/share/gnome-remote-desktop/rdp-tls.crt
|
||||
grdctl rdp set-tls-key /home/"${user}"/.local/share/gnome-remote-desktop/rdp-tls.key
|
||||
grdctl rdp set-tls-cert "${HOME}/.local/share/gnome-remote-desktop/rdp-tls.crt"
|
||||
grdctl rdp set-tls-key "${HOME}/.local/share/gnome-remote-desktop/rdp-tls.key"
|
||||
grdctl rdp set-credentials "${user}" "${password}"
|
||||
grdctl rdp disable-view-only
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ Command|Description
|
|||
`fix_ethernet_speed <DEVICE> <SPEED>`|Fix when ethernet mistakenly detects 100 Mb instead of 1000 Mb. SPEED is one of 10/100/1000 etc.
|
||||
`fix_files_sftp`| Fix nautilus after typing wrong sftp password.
|
||||
`fix_gradle_lock`| Delete lost Gradle lock files.
|
||||
`fix_gnome_rdp`|Fix Gnome's broken RDP ffs.
|
||||
`fix_gnome_rdp <PASSWORD>`|Fix Gnome's broken RDP ffs.
|
||||
|
||||
## Git.
|
||||
|
||||
|
|
Reference in a new issue