[tor-commits] [ooni-probe/master] add script to install openvpn for the openvpn test

art at torproject.org art at torproject.org
Wed Dec 2 11:49:13 UTC 2015


commit 39f111fa5bca3653908132bd53ee76f38d35401c
Author: juga0 <juga>
Date:   Thu Nov 19 15:36:51 2015 +0000

    add script to install openvpn for the openvpn test
---
 scripts/openvpn_install.sh |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/scripts/openvpn_install.sh b/scripts/openvpn_install.sh
new file mode 100755
index 0000000..b9ab549
--- /dev/null
+++ b/scripts/openvpn_install.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+user="$(id -un 2>/dev/null || true)"
+
+sh_c='sh -c'
+
+if [ "$user" != 'root' ]; then
+	if command_exists sudo; then
+		sh_c='sudo sh -c -E'
+	elif command_exists su; then
+		sh_c='su -c --preserve-environment'
+	else
+		echo >&2 'Error: this installer needs the ability to run commands as root.'
+		echo >&2 'We are unable to find either "sudo" or "su" available to make this happen.'
+		exit 1
+	fi
+fi
+
+$sh_c "apt-get -y install openvpn"





More information about the tor-commits mailing list