[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 73b6546d3344a06207b9ba54717d5b0c2b49c5ad
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"



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits