Как скопировать файл в буфер обмена с помощью терминала?

Ключом пользовательской конфигурации является использование клиента -подключения опции

Выдержка из vpn -endpoint.conf

script-security 2
client-connect /etc/openvpn/up-client

Очень простой скрипт

 #!/bin/sh
 CONFIG_FILE=$1
 ( env ; echo CONFIG_FILE  ${CONFIG_FILE} ) >> /var/log/openvpn-up-client.log
 case "$username" in
    (me)
         echo 'push "route 192.168.168.168 255.255.255.255"' >>${CONFIG_FILE}
         ;;
    (*)
         echo 'push "route 192.168.169.169 255.255.255.255"' >>${CONFIG_FILE}
         ;;
 esac

Выдержка из man openvpn

--client-connect cmd

Run command cmd on client connection.

cmd consists of a path to script (or executable program), optionally followed by arguments.

The path and arguments may be single- or double-quoted and/or escaped using a backslash, and should be separated by one or more spaces.

The command is passed the common name and IP address of the just-authenticated client as environmental variables (see environmental variable section below). The command is also passed the pathname of a freshly created temporary file as the last argument (after any arguments specified in cmd ), to be used by the command to pass dynamically generated config file directives back to OpenVPN.

If the script wants to generate a dynamic config file to be applied on the server when the client connects, it should write it to the file named by the last argument.

See the --client-config-dir option below for options which can be legally used in a dynamically generated config file.

Note that the return value of script is significant. If script returns a non-zero error status, it will cause the client to be disconnected.

0
23.05.2021, 22:02
1 ответ

Только что протестировал xsel, все работает. Сдвиг+ин пробовал? Это подходит для меня.

$ xsel -b <<< bla
# or
$ xsel -b <<< "bla bla"
# for string with spaces
0
28.07.2021, 11:30

Теги

Похожие вопросы