Browse Source

Added JSON parser for pulling Git metadata and doing updates

pull/525/head
Jared Ballou 9 years ago
parent
commit
63595d5e9b
  1. 13
      Insurgency/insserver
  2. BIN
      functions/jq-linux64

13
Insurgency/insserver

@ -37,7 +37,7 @@ servicename="$(basename $0)"
# Github Branch Select # Github Branch Select
# Allows for the use of different function files # Allows for the use of different function files
# from a different repo and/or branch. # from a different repo and/or branch.
githubuser="jaredballou" githubuser="dgibbs64"
githubrepo="linuxgsm" githubrepo="linuxgsm"
githubbranch="master" githubbranch="master"
@ -156,7 +156,6 @@ do
fi fi
done done
done done
echo "mark"
# If we have no executable fetchcmd, fail script execution # If we have no executable fetchcmd, fail script execution
if [ ! -x "${fetchcmd}" ]; then if [ ! -x "${fetchcmd}" ]; then
fn_colortext 31 FAIL fn_colortext 31 FAIL
@ -184,13 +183,11 @@ fn_getgithubfile(){
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
echo -e " fetching ${filename} (${githuburl})\c" echo -e " fetching ${filename} (${githuburl})\c"
if [ "$(basename ${fetchcmd})" == "curl" ]; then if [ "$(basename ${fetchcmd})" == "curl" ]; then
cmd="$fetchcmd --fail -o" cmd="$fetchcmd -s --fail -o"
elif [ "$(basename ${fetchcmd})" == "wget" ]; then elif [ "$(basename ${fetchcmd})" == "wget" ]; then
cmd="$fetchcmd -O" cmd="$fetchcmd -O"
fi fi
fetch=$($cmd "${filepath}" "${githuburl}" 2>&1) fetch=$($cmd "${filepath}" "${githuburl}" 2>&1)
echo $?
echo $fetch
if [ "${exec}" ]; then if [ "${exec}" ]; then
chmod +x "${filepath}" chmod +x "${filepath}"
fi fi
@ -200,13 +197,11 @@ fn_getgithubfile(){
fi fi
} }
echo "mark"
# fn_runfunction # fn_runfunction
fn_runfunction(){ fn_runfunction(){
fn_getgithubfile "functions/${functionfile}" 1 fn_getgithubfile "functions/${functionfile}" 1
} }
echo "mark"
# core_functions.sh # core_functions.sh
core_functions.sh(){ core_functions.sh(){
# Functions are defined in core_functions.sh. # Functions are defined in core_functions.sh.
@ -214,11 +209,7 @@ core_functions.sh(){
fn_runfunction fn_runfunction
} }
echo "mark"
core_functions.sh core_functions.sh
echo "mark"
getopt=$1 getopt=$1
core_getopt.sh core_getopt.sh
echo "mark"
echo "done"

BIN
functions/jq-linux64

Binary file not shown.
Loading…
Cancel
Save