Fix : Refactor Gnome RDP a bit.

This commit is contained in:
Dmitry Voronin 2024-02-03 03:59:52 +03:00
parent 8d8b0013ca
commit 51eb7a6092
2 changed files with 182 additions and 182 deletions

View file

@ -24,13 +24,13 @@ function fix_gradle_lock() {
} }
# Fix Gnome's broken RDP ffs. # Fix Gnome's broken RDP ffs.
# Usage: fix_gnome_rdp <USER> <PASSWORD> # Usage: fix_gnome_rdp <PASSWORD>
function fix_gnome_rdp() { function fix_gnome_rdp() {
local user="${1}" local user="${USERNAME}"
local password="${2}" local password="${1}"
# Check params. # Check params.
if [[ "${user}" = "" ]] || [[ "${password}" = "" ]]; then if [[ "${password}" = "" ]]; then
help fix_gnome_rdp help fix_gnome_rdp
return 2 return 2
fi fi
@ -43,12 +43,12 @@ function fix_gnome_rdp() {
cd /tmp cd /tmp
openssl genrsa -out rdp-tls.key 4096 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 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/ mkdir -p "${HOME}/.local/share/gnome-remote-desktop/"
mv rdp-tls.key rdp-tls.crt /home/"${user}"/.local/share/gnome-remote-desktop/ mv rdp-tls.key rdp-tls.crt "${HOME}/.local/share/gnome-remote-desktop/"
# Configure RDP. # Configure RDP.
grdctl rdp set-tls-cert /home/"${user}"/.local/share/gnome-remote-desktop/rdp-tls.crt grdctl rdp set-tls-cert "${HOME}/.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-key "${HOME}/.local/share/gnome-remote-desktop/rdp-tls.key"
grdctl rdp set-credentials "${user}" "${password}" grdctl rdp set-credentials "${user}" "${password}"
grdctl rdp disable-view-only grdctl rdp disable-view-only

View file

@ -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_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_files_sftp`| Fix nautilus after typing wrong sftp password.
`fix_gradle_lock`| Delete lost Gradle lock files. `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. ## Git.