/usr/bin/ionstart is in ion 3.2.1+dfsg-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | #!/bin/bash
#
# ionstart
# David Young
# Aug 10, 2008
#
# Program will start ion using a configuration file specified in the command
# line arguments. The configuration file must be tagged with lines delimiting
# which sections of the file are configuration commands for the various ion
# administration interfaces.
ION_OPEN_SOURCE=1
# the location of the awkscript.
# defining the environment variable AWKSCRIPT before running this script
# will work (for things like make test) before installation
if [[ ! -r "${AWKSCRIPT}" ]] ; then
SUBFOLDER=`dirname "${0}"`
# assuming this bash script is installed with the usual binaries from autoconf
AWKSCRIPT="${SUBFOLDER}/../share/ion/ionstart.awk"
if [[ ! -r "${AWKSCRIPT}" ]] ; then
echo
echo "Didn't find awk script in ${AWKSCRIPT} now searching locally..."
# assume the bash script is in the same location as the awk script
AWKSCRIPT="${SUBFOLDER}/ionstart.awk"
if [[ ! -r "${AWKSCRIPT}" ]] ; then
echo
echo "Cannot find the location of the awk script."
echo "I thought it would be ${AWKSCRIPT} , but nothing is there."
echo "Set the environment variable AWKSCRIPT or edit me in ${0}"
exit 1
fi
fi
fi
function USAGE {
echo
echo "IONSTART: Interplanetary Overlay Network startup script"
echo "USAGE:"
echo " ionstart [-I config] [-t tag] [-a acsrc] [-b bprc] [-B bssrc]"
echo " [-d dtn2rc] [-i ionrc] [-l ltprc] [-m imcrc] [-p ipnrc]"
echo -n " [-s ionsecrc]"
if [ "$ION_OPEN_SOURCE" == "1" ]; then
echo " [-c cfdprc]"
else
echo ""
fi
echo ""
echo " Defined configurations will be run in the following order:"
echo -n " config, ionrc, ionsecrc, ltprc, bprc, ipnrc, dtn2rc, acsrc, imcrc, bssrc"
if [ "$ION_OPEN_SOURCE" == "1" ]; then
echo ", cfdprc"
else
echo ""
fi
echo
echo " -I config Specifies file containing the configuration for each"
echo " ion administration program. Each section must be"
echo " preceded by: ## begin programname tag"
echo " and proceeded by: ## end programname tag"
echo
echo " -t tag Optional tag, used to specify which sections are used"
echo " in config file. If unspecified, sections with no tag"
echo " are used."
echo
echo " -a acsrc Specifies file acsrc to be used to configure acsadmin."
echo " -b bprc Specifies file bprc to be used to configure bpadmin."
echo " -B bssrc Specifies file bssrc to be used to configure bssadmin."
echo " -d dtn2rc Specifies file dtn2rc to be used to configure dtn2admin."
echo " -i ionrc Specifies file ionrc to be used to configure ionadmin."
echo " -l ltprc Specifies file ltprc to be used to configure ltpadmin."
echo " -m imcrc Specifies file imcrc to be used to configure imcdmin."
echo " -p ipnrc Specifies file ipnrc to be used to configure ipnadmin."
echo " -s ionsecrc Specifies file ionsecrc to be used to configure ionsecadmin."
if [ "$ION_OPEN_SOURCE" == "1" ]; then
echo " -c cfdprc Specifies file cfdprc to be used to configure cfdpadmin."
fi
}
# check for all the options
while getopts ":t:i:c:I:d:p:b:l:s:a:B:m:h" options; do
case $options in
t ) TAG="${OPTARG}";;
i ) IONRC="${OPTARG}"
if [[ ! -r "${OPTARG}" ]] ; then
echo
echo "The ionrc file ${OPTARG} can't be read."
failure="TRUE"
fi;;
c ) CFDPRC="${OPTARG}"
if [[ ! -r "${OPTARG}" ]]; then
echo
echo "The cfdprc file ${OPTARG} can't be read."
failure="TRUE"
fi
if [ "$ION_OPEN_SOURCE" == "0" ]; then
echo
echo "CFDP is not available"
failure="TRUE"
fi
;;
d ) DTN2RC="${OPTARG}"
if [[ ! -r "${OPTARG}" ]] ; then
echo
echo "The dtn2rc file ${OPTARG} can't be read."
failure="TRUE"
fi;;
p ) IPNRC="${OPTARG}"
if [[ ! -r "${OPTARG}" ]] ; then
echo
echo "The ipnrc file ${OPTARG} can't be read."
failure="TRUE"
fi;;
s ) IONSECRC="${OPTARG}"
if [[ ! -r "${OPTARG}" ]] ; then
echo
echo "The ionsecrc file ${OPTARG} can't be read."
failure="TRUE"
fi;;
a ) ACSRC="${OPTARG}"
if [[ ! -r "${OPTARG}" ]] ; then
echo
echo "The acsrc file ${OPTARG} can't be read."
failure="TRUE"
fi;;
b ) BPRC="${OPTARG}"
if [[ ! -r "${OPTARG}" ]] ; then
echo
echo "The bprc file ${OPTARG} can't be read."
failure="TRUE"
fi;;
B ) BSSRC="${OPTARG}"
if [[ ! -r "${OPTARG}" ]] ; then
echo
echo "The bssrc file ${OPTARG} can't be read."
failure="TRUE"
fi;;
m ) IMCRC="${OPTARG}"
if [[ ! -r "${OPTARG}" ]] ; then
echo
echo "The imcrc file ${OPTARG} can't be read."
failure="TRUE"
fi;;
l ) LTPRC="${OPTARG}"
if [[ ! -r "${OPTARG}" ]] ; then
echo
echo "The ltprc file ${OPTARG} can't be read."
failure="TRUE"
fi;;
I ) CONFIGFILE="${OPTARG}"
if [[ ! -r "${OPTARG}" ]] ; then
echo
echo "The config file ${OPTARG} can't be read."
failure="TRUE"
fi;;
h ) USAGE
exit 1;;
\? ) USAGE
exit 1;;
* ) USAGE
exit 1;;
esac
done
if [[ -z "${CONFIGFILE}" && -z "${IONRC}" && -z "${BPRC}" && -z "${CFDPRC}" && -z "${LTPRC}" && -z "${IPNRC}" && -z "${IONSECRC}" && -z "${DTN2RC}" && -z "${ACSRC}" && -z "${BSSRC}" && -z "${IMCRC}" ]] ; then
echo
echo "You must define some configuration files for input, use any combination of the"
echo "-b -B -c -d -i -I -l -m -p -s -a options to define them."
USAGE
exit 1
fi
if [[ "${failure}" == "TRUE" ]] ; then
exit 1
fi
if [[ ! -z "${BSSRC}" ]] && [[ ! -z "${IPNRC}" ]] ; then
echo "Error: bss and ipn are mutually exclusive!"
exit 1
fi
if [[ ! -z "${CONFIGFILE}" ]] ; then
echo
echo "Now running startup script using ${CONFIGFILE}"
awk -f "${AWKSCRIPT}" -v configfile="${CONFIGFILE}" -v tag="${TAG}" "${CONFIGFILE}"
fi
if [[ ! -z "${IONRC}" ]] ; then
echo
echo "Now running ionadmin using ${IONRC}"
ionadmin "${IONRC}"
fi
if [[ ! -z "${IONSECRC}" ]]; then
echo
echo "Now running ionsecadmin using ${IONSECRC}"
ionsecadmin "${IONSECRC}"
fi
if [[ ! -z "${LTPRC}" ]] ; then
echo
echo "Now running ltpadmin using ${LTPRC}"
ltpadmin "${LTPRC}"
fi
if [[ ! -z "${BPRC}" ]] ; then
echo
echo "Now running bpadmin using ${BPRC}"
bpadmin "${BPRC}"
fi
if [[ ! -z "${IPNRC}" ]] ; then
echo
echo "Now running ipnadmin using ${IPNRC}"
ipnadmin "${IPNRC}"
fi
if [[ ! -z "${DTN2RC}" ]] ; then
echo
echo "Now running dtn2admin using ${DTN2RC}"
dtn2admin ${DTN2NODE} "${DTN2RC}"
fi
if [[ ! -z "${ACSRC}" ]] ; then
echo
echo "Now running acsadmin using ${ACSRC}"
acsadmin "${ACSRC}"
fi
if [[ ! -z "${IMCRC}" ]] ; then
echo
echo "Now running imcadmin using ${IMCRC}"
imcadmin "${IMCRC}"
fi
if [[ ! -z "${BSSRC}" ]] ; then
echo
echo "Now running bssadmin using ${BSSRC}"
bssadmin "${BSSRC}"
fi
if [[ ! -z "${CFDPRC}" ]] && [ "$ION_OPEN_SOURCE" == "1" ]; then
echo
echo "Now running cfdpadmin using ${CFDPRC}"
cfdpadmin "${CFDPRC}"
fi
echo
echo Allowing admin programs to complete...
echo
sleep 5
echo
echo "ION startup script completed."
echo "You may find that the ION node has not started. If this is the case,"
echo "some errors may have been reported to the console."
echo "Further errors may be found in the file ion.log"
|