Commit 5b14e3cd authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play: use esu instead of $SUDO

parent 1c65cc7d
The main purpose of any play.d script is to download and to install a package.
Allowed variables:
* $SUDO (will filled with 'sudo' command when running without root privilegies
Allowed commands:
* epm (run the same epm called from)
* epm print info (instead of epm print info)
* epm tool eget (wget like utility)
* epm tool estrlist (string operations)
* esu (wrapper for [sudo ] su - -c "command")
* serv
See any file for
. $(dirname $0)/common.sh
......
......@@ -194,11 +194,6 @@ if [ -x "../bin/epm" ] ; then
export PATH="$(realpath ../bin):$PATH"
fi
if [ -z "$SUDO" ] && [ "$UID" != "0" ] ; then
SUDO="sudo"
fi
# set PKGNAME to $BASEPKGNAME-$VERSION if $VERSION is found in PRODUCTALT
[ -n "$PRODUCTALT" ] && check_alternative_pkgname
......
......@@ -41,7 +41,7 @@ case "$(epm print info -d)" in
esac
if [ -z "$EPM_AUTO" ] ; then
$SUDO /opt/mssql/bin/mssql-conf setup accept-eula
esu /opt/mssql/bin/mssql-conf setup accept-eula
serv mssql-server on
else
cat <<EOF
......
......@@ -37,8 +37,8 @@ case "$(epm print info -d)" in
;;
esac
$SUDO odbcinst -i -d -f /opt/microsoft/msodbcsql17/etc/odbcinst.ini
$SUDO odbcinst -q -d
esu odbcinst -i -d -f /opt/microsoft/msodbcsql17/etc/odbcinst.ini
esu odbcinst -q -d
cat <<EOF
......
......@@ -54,10 +54,10 @@ epm install $(url_by_id_content "browser-b2c-$id_content")
ERR=$?
if [ "$ERR" = 0 ] ; then
echo "Running # /opt/sputnik-browser/sputnik_client --generate_branding to get license in config.dat"
a='' $SUDO /opt/sputnik-browser/sputnik_client --generate_branding
esu /opt/sputnik-browser/sputnik_client --generate_branding
echo "Disable strange system service sputnik_client"
serv sputnik_client off
$SUDO killall sputnik_client
esu killall sputnik_client
fi
exit $ERR
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment