| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 1 | #! /bin/bash | 
|  | 2 |  | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 3 | help=$(cat << EOF | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 4 | dreport creates an archive(xz compressed) consisting of the following: | 
|  | 5 | * Configuration information | 
|  | 6 | * Debug information | 
|  | 7 | * A summary report | 
|  | 8 | The type parameter controls the content of the data. The generated | 
|  | 9 | archive is stored in the user specified location. | 
|  | 10 |  | 
|  | 11 | usage: dreport [OPTION] | 
|  | 12 |  | 
|  | 13 | Options: | 
|  | 14 | -n, —-name <name>     Name to be used for the archive. | 
|  | 15 | Default name format obmcdump_<id>_<epochtime> | 
|  | 16 | -d, —-dir <directory> Archive directory to copy the compressed report. | 
|  | 17 | Default output directory is /tmp | 
|  | 18 | -i, —-id <id>         Dump identifier to associate with the archive. | 
|  | 19 | Identifiers include numeric characters. | 
|  | 20 | Default dump identifier is 0 | 
|  | 21 | -t, —-type <type>     Data collection type. Valid types are | 
|  | 22 | "user", "core", "elog". | 
|  | 23 | Default type is "user" initiated. | 
|  | 24 | -p, —-path <path>     Optional contents to be included in the archive. | 
|  | 25 | Valid paths are absolute file path or d-bus path | 
|  | 26 | based on type parameter. | 
|  | 27 | -Absolute file path for "core" type. | 
|  | 28 | -elog d-bus object for "elog" type. | 
|  | 29 | -s, --size <size>     Maximum allowed size(in KB) of the archive. | 
|  | 30 | Report will be truncated in case size exceeds | 
|  | 31 | this limit. Default size is unlimited. | 
|  | 32 | -v, —-verbose         Increase logging verbosity. | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 33 | -q, —-quiet           Only log fatal errors to stderr | 
|  | 34 | -h, —-help            Display this help and exit. | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 35 | EOF | 
|  | 36 | ) | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 37 |  | 
|  | 38 | #CONSTANTS | 
|  | 39 | declare -rx TRUE=1 | 
|  | 40 | declare -rx FALSE=0 | 
|  | 41 | declare -rx UNLIMITED="unlimited" | 
|  | 42 | declare -rx SUMMARY_DUMP="summary" | 
|  | 43 | declare -rx TYPE_USER="user" | 
|  | 44 | declare -rx TYPE_CORE="core" | 
|  | 45 | declare -rx TYPE_ELOG="elog" | 
| Marri Devender Rao | 0deb287 | 2018-11-12 07:45:54 -0600 | [diff] [blame] | 46 | declare -rx TYPE_CHECKSTOP="checkstop" | 
| George Liu | ff92ffe | 2021-02-09 15:01:53 +0800 | [diff] [blame] | 47 | declare -rx TYPE_RAMOOPS="ramoops" | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 48 | declare -rx SUMMARY_LOG="summary.log" | 
|  | 49 | declare -rx DREPORT_LOG="dreport.log" | 
|  | 50 | declare -rx TMP_DIR="/tmp" | 
|  | 51 | declare -rx EPOCHTIME=$(date +"%s") | 
|  | 52 | declare -rx TIME_STAMP="date -u" | 
|  | 53 | declare -rx PLUGIN="pl_" | 
|  | 54 | declare -rx DREPORT_SOURCE="/usr/share/dreport.d" | 
|  | 55 | declare -rx DREPORT_INCLUDE="$DREPORT_SOURCE/include.d" | 
| Jayanth Othayoth | aa146d6 | 2018-01-08 06:57:53 -0600 | [diff] [blame] | 56 | declare -rx ZERO="0" | 
|  | 57 | declare -rx JOURNAL_LINE_LIMIT="500" | 
| Chirag Sharma | c237e3d | 2020-09-15 12:01:01 -0500 | [diff] [blame] | 58 | declare -rx HEADER_EXTENSION="$DREPORT_INCLUDE/gendumpheader" | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 59 |  | 
|  | 60 | #Error Codes | 
|  | 61 | declare -rx SUCCESS="0" | 
|  | 62 | declare -rx INTERNAL_FAILURE="1" | 
|  | 63 | declare -rx RESOURCE_UNAVAILABLE="2" | 
|  | 64 |  | 
|  | 65 | #VARIABLES | 
|  | 66 | declare -x name="" | 
|  | 67 | declare -x dump_dir="/tmp" | 
|  | 68 | declare -x dump_id="00000000" | 
|  | 69 | declare -x dump_type=$TYPE_USER | 
|  | 70 | declare -x verbose=$FALSE | 
|  | 71 | declare -x quiet=$FALSE | 
|  | 72 | declare -x dump_size="unlimited" | 
|  | 73 | declare -x name_dir="" | 
|  | 74 | declare -x optional_path="" | 
|  | 75 | declare -x dreport_log="" | 
|  | 76 | declare -x summary_log="" | 
|  | 77 | declare -x cur_dump_size=0 | 
| Jayanth Othayoth | aa146d6 | 2018-01-08 06:57:53 -0600 | [diff] [blame] | 78 | declare -x pid=$ZERO | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 79 | declare -x elog_id="" | 
|  | 80 |  | 
|  | 81 | #Source dreport common functions | 
|  | 82 | . $DREPORT_INCLUDE/functions | 
|  | 83 |  | 
|  | 84 | # @brief Initiate data collection based on the type. | 
|  | 85 | # @return 0 on success, error code otherwise | 
|  | 86 | function collect_data() | 
|  | 87 | { | 
|  | 88 | case $dump_type in | 
|  | 89 | $TYPE_USER) | 
|  | 90 | ;; | 
|  | 91 | $TYPE_CORE) | 
|  | 92 | log_summary "Core: $optional_path" | 
|  | 93 | set_core_pid | 
|  | 94 | ;; | 
| George Liu | ff92ffe | 2021-02-09 15:01:53 +0800 | [diff] [blame] | 95 | $TYPE_RAMOOPS) | 
|  | 96 | log_summary "Ramoops: $optional_path" | 
|  | 97 | ;; | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 98 | $TYPE_ELOG) | 
|  | 99 | log_summary "ELOG: $optional_path" | 
|  | 100 | elog_id=$(basename "$optional_path") | 
|  | 101 | set_elog_pid | 
|  | 102 | ;; | 
| Marri Devender Rao | 0deb287 | 2018-11-12 07:45:54 -0600 | [diff] [blame] | 103 | $TYPE_CHECKSTOP) | 
|  | 104 | log_summary "CHECKSTOP: $optional_path" | 
|  | 105 | elog_id=$(basename "$optional_path") | 
|  | 106 | set_elog_pid | 
|  | 107 | ;; | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 108 |  | 
|  | 109 | $SUMMARY_DUMP) | 
|  | 110 | #No data collection is required. | 
|  | 111 | return | 
|  | 112 | ;; | 
|  | 113 | *) # unknown option | 
|  | 114 | log_error "Skipping: Unknown dump type: $dump_type" | 
|  | 115 | return | 
|  | 116 | ;; | 
|  | 117 | esac | 
|  | 118 |  | 
|  | 119 | plugin_path=$DREPORT_SOURCE/$PLUGIN$dump_type.d | 
|  | 120 |  | 
|  | 121 | # check plugin directory for this dump type? | 
|  | 122 | if [ ! -d $plugin_path ]; then | 
|  | 123 | log_error "$plugin_path does not exist, skipping dump collection" | 
|  | 124 | return 0 | 
|  | 125 | fi | 
|  | 126 |  | 
|  | 127 | #Executes plugins based on the type. | 
|  | 128 | for i in $plugin_path/* ; do | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 129 | $i | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 130 | done | 
|  | 131 | } | 
|  | 132 |  | 
|  | 133 | # @brief set pid by reading information from the optional path. | 
|  | 134 | #        dreport "core" type user provides core file as optional path parameter. | 
|  | 135 | #        As per coredump source code systemd-coredump uses below format | 
|  | 136 | #        https://github.com/systemd/systemd/blob/master/src/coredump/coredump.c | 
|  | 137 | #        /var/lib/systemd/coredump/core.%s.%s." SD_ID128_FORMAT_STR “. | 
|  | 138 | #        <process ID>.%s000000" | 
|  | 139 | function set_core_pid() | 
|  | 140 | { | 
|  | 141 | #Escape bash characters in file name | 
|  | 142 | file=$(printf %q "$optional_path") | 
|  | 143 |  | 
|  | 144 | #matching systemd-coredump core file format. | 
|  | 145 | pid=$(echo $file | awk -F . '{ print $5}') | 
|  | 146 | } | 
|  | 147 |  | 
|  | 148 | # @brief set elog pid by reading _PID information from the elog d-bus object. | 
|  | 149 | #        _PID information is stored  elog Additional data field | 
|  | 150 | #        Data format  "_PID=<pid>" | 
|  | 151 | function set_elog_pid() | 
|  | 152 | { | 
|  | 153 | additional_data=$(busctl get-property xyz.openbmc_project.Logging \ | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 154 | $optional_path \ | 
|  | 155 | xyz.openbmc_project.Logging.Entry \ | 
|  | 156 | AdditionalData) | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 157 |  | 
|  | 158 | #read _PID data. | 
|  | 159 | if [ ! -z "$additional_data" ]; then | 
|  | 160 | pid=$(echo $additional_data | \ | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 161 | awk -F _PID= '{ print ($2+0)}') | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 162 | fi | 
|  | 163 | } | 
|  | 164 |  | 
|  | 165 | # @brief Initial version of the summary log | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 166 | function init_summary() | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 167 | { | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 168 | log_summary "Name:          $name.tar.xz" | 
|  | 169 | log_summary "Epochtime:     $EPOCHTIME" | 
|  | 170 | log_summary "ID:            $dump_id" | 
|  | 171 | log_summary "Type:          $dump_type" | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 172 | } | 
|  | 173 |  | 
|  | 174 | # @brief Check the validity of user inputs and initialize global | 
|  | 175 | #        variables. Create directory for temporary data collection | 
|  | 176 | # @return 0 on success, error code otherwise | 
|  | 177 |  | 
|  | 178 | function initialize() | 
|  | 179 | { | 
|  | 180 | #Dump file name | 
|  | 181 | if [ -z $name ]; then | 
|  | 182 | name=$"obmcdump_"$dump_id"_$EPOCHTIME" | 
|  | 183 | fi | 
|  | 184 |  | 
|  | 185 | #Create temporary data directory. | 
|  | 186 | mkdir -p "$TMP_DIR/$name" | 
|  | 187 | if [ $? -ne 0 ]; then | 
|  | 188 | echo "Error: Failed to create the temporary directory." | 
|  | 189 | return $RESOURCE_UNAVAILABLE; | 
|  | 190 | fi | 
|  | 191 |  | 
|  | 192 | #name directory | 
|  | 193 | name_dir="$TMP_DIR/$name" | 
|  | 194 |  | 
|  | 195 | #dreport log file | 
|  | 196 | dreport_log="$name_dir/$DREPORT_LOG" | 
|  | 197 |  | 
|  | 198 | #summary log file | 
|  | 199 | summary_log="$name_dir/$SUMMARY_LOG" | 
|  | 200 |  | 
|  | 201 | #Type | 
| Jayanth Othayoth | 40d6719 | 2023-02-01 06:36:38 -0600 | [diff] [blame] | 202 | if ! { [[ $dump_type = "$TYPE_USER" ]] || \ | 
|  | 203 | [[ $dump_type = "$TYPE_CORE" ]] || \ | 
|  | 204 | [[ $dump_type = "$TYPE_ELOG" ]] || \ | 
|  | 205 | [[ $dump_type = "$TYPE_RAMOOPS" ]] || \ | 
|  | 206 | [[ $dump_type = "$TYPE_CHECKSTOP" ]]; }; then | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 207 | log_error "Invalid -type, Only summary log is available" | 
|  | 208 | dump_type=$SUMMARY_DUMP | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 209 | fi | 
|  | 210 |  | 
|  | 211 | #Size | 
|  | 212 | #Check the input is integer. | 
|  | 213 | if [ "$dump_size" -eq "$dump_size" ] 2>/dev/null; then | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 214 | #Converts in to bytes. | 
|  | 215 | dump_size="$((dump_size * 1024))" | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 216 | else | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 217 | dump_size=$UNLIMITED | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 218 | fi | 
|  | 219 |  | 
|  | 220 | return $SUCCESS | 
|  | 221 | } | 
|  | 222 |  | 
|  | 223 | # @brief Packaging the dump and transferring to dump location. | 
|  | 224 | function package() | 
|  | 225 | { | 
|  | 226 | mkdir -p "$dump_dir" | 
|  | 227 | if [ $? -ne 0 ]; then | 
|  | 228 | log_error "Could not create the destination directory $dump_dir" | 
|  | 229 | dest_dir=$TMP_DIR | 
|  | 230 | fi | 
|  | 231 |  | 
|  | 232 | #tar and compress the files. | 
| Chirag Sharma | c237e3d | 2020-09-15 12:01:01 -0500 | [diff] [blame] | 233 | if [ -f "$HEADER_EXTENSION" ]; then | 
|  | 234 | tar -Jcf "$name_dir.tar.xz" -C \ | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 235 | $(dirname "$name_dir") $(basename "$name_dir") | 
| Chirag Sharma | c237e3d | 2020-09-15 12:01:01 -0500 | [diff] [blame] | 236 | echo "Adding Dump Header :"$HEADER_EXTENSION | 
|  | 237 | ("$HEADER_EXTENSION") | 
|  | 238 | cat "$name_dir.tar.xz" | tee -a "/tmp/dumpheader_$EPOCHTIME" > /dev/null | 
|  | 239 | mv "/tmp/dumpheader_$EPOCHTIME" "$name_dir.tar.xz" | 
|  | 240 | else | 
|  | 241 | tar -Jcf "$name_dir.tar.xz" -C \ | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 242 | $(dirname "$name_dir") $(basename "$name_dir") | 
| Chirag Sharma | c237e3d | 2020-09-15 12:01:01 -0500 | [diff] [blame] | 243 | fi | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 244 |  | 
|  | 245 | if [ $? -ne 0 ]; then | 
|  | 246 | echo $($TIME_STAMP) "Could not create the compressed tar file" | 
|  | 247 | rm -r "$name_dir" | 
|  | 248 | return $INTERNAL_FAILURE | 
|  | 249 | fi | 
|  | 250 |  | 
|  | 251 | #remove the temporary name specific directory | 
|  | 252 | rm -r "$name_dir" | 
|  | 253 |  | 
|  | 254 | echo $($TIME_STAMP) "Report is available in $dump_dir" | 
|  | 255 |  | 
| Chirag Sharma | a63f4a6 | 2020-07-13 06:14:22 -0500 | [diff] [blame] | 256 | if [ "$TMP_DIR" == "$dump_dir" ] || [ "$TMP_DIR/" == "$dump_dir" ]; then | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 257 | return $SUCCESS | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 258 | fi | 
|  | 259 |  | 
|  | 260 | #copy the compressed tar file into the destination | 
|  | 261 | cp "$name_dir.tar.xz" "$dump_dir" | 
|  | 262 | if [ $? -ne 0 ]; then | 
|  | 263 | echo "Failed to copy the $name_dir.tar.xz to $dump_dir" | 
|  | 264 | rm "$name_dir.tar.xz" | 
|  | 265 | return $INTERNAL_FAILURE | 
|  | 266 | fi | 
|  | 267 |  | 
|  | 268 | #Remove the temporary copy of the file | 
|  | 269 | rm "$name_dir.tar.xz" | 
|  | 270 | } | 
|  | 271 |  | 
|  | 272 | # @brief Main function | 
|  | 273 | function main() | 
|  | 274 | { | 
|  | 275 | #initialize the global variables and | 
|  | 276 | #create temporary storage locations | 
|  | 277 | initialize | 
|  | 278 | result=$? | 
|  | 279 | if [[ ${result} -ne $SUCCESS ]]; then | 
|  | 280 | echo $($TIME_STAMP) "Error: Failed to initialize, Exiting" | 
|  | 281 | exit; | 
|  | 282 | fi | 
|  | 283 |  | 
| Gunnar Mills | 95a7298 | 2017-10-25 17:00:14 -0500 | [diff] [blame] | 284 | #Initialize the summary log | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 285 | init_summary | 
|  | 286 |  | 
|  | 287 | #collect data based on the type. | 
|  | 288 | collect_data | 
|  | 289 |  | 
|  | 290 | package  #package the dump | 
|  | 291 | result=$? | 
|  | 292 | if [[ ${result} -ne $SUCCESS ]]; then | 
|  | 293 | echo $($TIME_STAMP) "Error: Failed to package, Exiting" | 
|  | 294 | else | 
| Gunnar Mills | 95a7298 | 2017-10-25 17:00:14 -0500 | [diff] [blame] | 295 | echo $($TIME_STAMP) "Successfully completed" | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 296 | exit; | 
|  | 297 | fi | 
|  | 298 | } | 
|  | 299 |  | 
| Matt Fischer | 971d1a7 | 2024-12-17 20:37:55 -0700 | [diff] [blame] | 300 | TEMP=`getopt -o n:d:i:t:s:p:vqh \ | 
|  | 301 | --long name:,dir:,dumpid:,type:,size:,path:,verbose,quiet,help \ | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 302 | -- "$@"` | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 303 |  | 
|  | 304 | if [ $? -ne 0 ] | 
|  | 305 | then | 
|  | 306 | echo "Error: Invalid options" | 
|  | 307 | exit 1 | 
|  | 308 | fi | 
|  | 309 |  | 
|  | 310 | eval set -- "$TEMP" | 
|  | 311 |  | 
|  | 312 | while [[ $# -gt 1 ]]; do | 
|  | 313 | key="$1" | 
|  | 314 | case $key in | 
|  | 315 | -n|--name) | 
|  | 316 | name=$2 | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 317 | shift 2 ;; | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 318 | -d|--dir) | 
|  | 319 | dump_dir=$2 | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 320 | shift 2 ;; | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 321 | -i|--dumpid) | 
|  | 322 | dump_id=$2 | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 323 | shift 2 ;; | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 324 | -t|--type) | 
|  | 325 | dump_type=$2 | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 326 | shift 2 ;; | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 327 | -s|--size) | 
|  | 328 | dump_size=$2 | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 329 | shift 2 ;; | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 330 | -p|--path) | 
|  | 331 | optional_path=$2 | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 332 | shift 2 ;; | 
| Matt Fischer | 971d1a7 | 2024-12-17 20:37:55 -0700 | [diff] [blame] | 333 | -v|--verbose) | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 334 | verbose=$TRUE | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 335 | shift ;; | 
| Matt Fischer | 971d1a7 | 2024-12-17 20:37:55 -0700 | [diff] [blame] | 336 | -q|--quiet) | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 337 | quiet=$TRUE | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 338 | shift ;; | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 339 | -h|--help) | 
|  | 340 | echo "$help" | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 341 | exit ;; | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 342 | *) # unknown option | 
|  | 343 | log_error "Unknown argument: $1" | 
|  | 344 | log_info "$help" | 
| Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 345 | exit 1 ;; | 
| Jayanth Othayoth | 5ce1550 | 2017-10-16 00:02:44 -0500 | [diff] [blame] | 346 | esac | 
|  | 347 | done | 
|  | 348 |  | 
|  | 349 | main #main program | 
|  | 350 | exit $? |