|
@@ -2,15 +2,19 @@ |
|
|
|
|
|
|
|
|
set -x |
|
|
set -x |
|
|
|
|
|
|
|
|
|
|
|
# Paths |
|
|
|
|
|
PASS="`which pass`" |
|
|
|
|
|
RDP="`which xfreerdp`" |
|
|
|
|
|
|
|
|
# VPN |
|
|
# VPN |
|
|
NMCONN="49088a1e-18c2-48aa-a664-f212eb83a727" |
|
|
NMCONN="49088a1e-18c2-48aa-a664-f212eb83a727" |
|
|
# RDP |
|
|
# RDP |
|
|
DEF_RESOLUTION="1920x1080" |
|
|
DEF_RESOLUTION="1920x1080" |
|
|
DRIVE="`xdg-user-dir DOCUMENTS`/Work" |
|
|
DRIVE="`xdg-user-dir DOCUMENTS`/Work" |
|
|
DOMAIN="$(pass show Work/AD-LOGIN | awk '/domain:/ {print $2}')" |
|
|
|
|
|
USER="$(pass show Work/AD-LOGIN | awk '/user:/ {print $2}')" |
|
|
|
|
|
REMOTE="$(pass show Work/AD-LOGIN | awk '/remote:/ {print $2}')" |
|
|
|
|
|
PASSWORD="$(pass show Work/AD-LOGIN | head -1)" |
|
|
|
|
|
|
|
|
DOMAIN="`pass show Work/AD-LOGIN | awk '/domain:/ {print $2}'`" |
|
|
|
|
|
USER="`pass show Work/AD-LOGIN | awk '/user:/ {print $2}'`" |
|
|
|
|
|
REMOTE="`pass show Work/AD-LOGIN | awk '/remote:/ {print $2}'`" |
|
|
|
|
|
PASSWORD="`pass show Work/AD-LOGIN | head -1`" |
|
|
|
|
|
|
|
|
[[ ! -d "${DRIVE}" ]] && mkdir -p ${DRIVE} |
|
|
[[ ! -d "${DRIVE}" ]] && mkdir -p ${DRIVE} |
|
|
|
|
|
|
|
@@ -34,11 +38,11 @@ rdp() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ $(nmcli con show ${NMCONN} | awk '/GENERAL.STATE/ {print $2}') == "activated" ]; then |
|
|
|
|
|
|
|
|
if [ `nmcli con show ${NMCONN} | awk '/GENERAL.STATE/ {print $2}'` = "activated" ]; then |
|
|
rdp |
|
|
rdp |
|
|
else |
|
|
else |
|
|
nmcli --ask con up ${NMCONN} |
|
|
nmcli --ask con up ${NMCONN} |
|
|
while [ $(nmcli con show ${NMCONN} | awk '/GENERAL.STATE/ {print $2}') != "activated" ]; do |
|
|
|
|
|
|
|
|
while [ `nmcli con show ${NMCONN} | awk '/GENERAL.STATE/ {print $2}'` != "activated" ]; do |
|
|
sleep 1 |
|
|
sleep 1 |
|
|
done |
|
|
done |
|
|
sleep 3 |
|
|
sleep 3 |
|
|