mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Update API test script to use 'sudo' if running as user and
needing to pkg install utils
This commit is contained in:
@@ -17,9 +17,15 @@ DEFCLASS="lifepreserver"
|
||||
# Set variable to call jsawk utility
|
||||
JSAWK="./utils/jsawk -j js24"
|
||||
|
||||
if [ `id -u` != "0" ] ; then
|
||||
pkgPre="sudo"
|
||||
else
|
||||
pkgPre=""
|
||||
fi
|
||||
|
||||
which npm >/dev/null 2>/dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
pkg install -y npm
|
||||
$pkgPre pkg install -y npm
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "Requires npm!"
|
||||
exit 1
|
||||
@@ -28,7 +34,7 @@ fi
|
||||
|
||||
pkg info p5-JSON >/dev/null 2>/dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
pkg install -y p5-JSON
|
||||
$pkgPre pkg install -y p5-JSON
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "Requires p5-JSON!"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user