Remove unnecessary process elevation
This commit is contained in:
parent
a5725b341c
commit
1ace953e8a
1 changed files with 13 additions and 24 deletions
37
install.sh
37
install.sh
|
@ -1,28 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
CONTEXT_ROOT="${CONTEXT_ROOT}";
|
contextRoot="$(mktemp -d)";
|
||||||
|
workingDir="$(pwd)";
|
||||||
|
scriptRoot="$(realpath "${BASH_SOURCE%/*}")";
|
||||||
|
patchFile="allow_insecure_crypto.patch";
|
||||||
|
patchedConfig="openssl_insecure_crypto.cnf";
|
||||||
|
|
||||||
if [ ! "$UID" -eq 0 ]
|
git clone https://aur.archlinux.org/networkmanager-openconnect-useragent-git.git "$contextRoot";
|
||||||
then
|
cd "$contextRoot";
|
||||||
CONTEXT_ROOT="$(mktemp -d)";
|
cp "$scriptRoot/$patchFile" .;
|
||||||
workingDir="$(pwd)";
|
cp "$scriptRoot/$patchedConfig" .;
|
||||||
|
|
||||||
sudo \
|
|
||||||
CONTEXT_ROOT="${CONTEXT_ROOT}" \
|
|
||||||
bash "$BASH_SOURCE";
|
|
||||||
|
|
||||||
cd "$CONTEXT_ROOT";
|
|
||||||
makepkg -si;
|
|
||||||
cd "$workingDir";
|
|
||||||
rm -rf "$CONTEXT_ROOT";
|
|
||||||
else
|
|
||||||
scriptRoot="$(realpath "${BASH_SOURCE%/*}")";
|
|
||||||
patchFile="allow_insecure_crypto.patch";
|
|
||||||
patchedConfig="openssl_insecure_crypto.cnf";
|
|
||||||
|
|
||||||
git clone https://aur.archlinux.org/networkmanager-openconnect-useragent-git.git "$CONTEXT_ROOT";
|
|
||||||
cd "$CONTEXT_ROOT";
|
|
||||||
cp "$scriptRoot/$patchFile" .;
|
|
||||||
cp "$scriptRoot/$patchedConfig" .;
|
|
||||||
|
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "/^depends=(/{ s/ openconnect / openconnect-git / }" \
|
-e "/^depends=(/{ s/ openconnect / openconnect-git / }" \
|
||||||
|
@ -39,4 +25,7 @@ else
|
||||||
-e 'a cp "${srcdir}/'"$patchedConfig"'" "${pkgdir}/usr/local/etc/ssl/openssl_insecure_crypto.cnf"' \
|
-e 'a cp "${srcdir}/'"$patchedConfig"'" "${pkgdir}/usr/local/etc/ssl/openssl_insecure_crypto.cnf"' \
|
||||||
-e "}" \
|
-e "}" \
|
||||||
PKGBUILD
|
PKGBUILD
|
||||||
fi;
|
|
||||||
|
makepkg -si;
|
||||||
|
cd "$workingDir";
|
||||||
|
rm -rf "$contextRoot";
|
||||||
|
|
Loading…
Reference in a new issue