# Rx3-Docker/Base Docker Image #------------------------------------------------------------------------------- FROM mageia:9 ARG IMG_URL ARG LANG ARG LANGUAGE ARG LOCALTIME #--------------------------------------------------------------------------------------------------- ARG LOCALE_CONF="LANG=${LANG} \n\ LANGUAGE=${LANGUAGE}" #--------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------- ARG RX3_SH='export PAGER=less \n\ export MANPAGER="less -isr" \n\ export EDITOR=emacs \n\ export ISL_FILE=/etc/img_stack_log \n\ \n\ \n\ \n\ cateval() \n\ { \n\ while read line \n\ do \n\ eval $line 2>/dev/null \n\ eval echo $( echo $line | sed -e `s/"/\\"/g`) \n\ done <$1 \n\ } \n\ \n\ export -f cateval \n\ \n\ \n\ \n\ print() \n\ { \n\ if [[ "$1" == "-i" ]] \n\ then \n\ shift \n\ \n\ str="%s"`\\\\n` \n\ else \n\ str="%s"`\\n` \n\ fi \n\ \n\ printf "${str}" "$*" \n\ } \n\ \n\ export -f print \n\ \n\ \n\ \n\ file_enable() \n\ { \n\ fd_file="$1" \n\ fd_state="$2" \n\ \n\ \n\ if [[ "$fd_state" == "TRUE" ]] \n\ then \n\ if [[ ! -f "${fd_file}" ]] \n\ then \n\ mv ${fd_file}.disable ${fd_file} \n\ fi \n\ else \n\ if [[ -f "${fd_file}" ]] \n\ then \n\ mv ${fd_file} ${fd_file}.disable \n\ fi \n\ fi \n\ } \n\ \n\ export -f file_enable \n\ \n\ \n\ \n\ isl_add() \n\ { \n\ url="$1" \n\ \n\ \n\ reg=${url%%/*} \n\ \n\ if [[ "${reg}" == *.* ]] \n\ then \n\ url=${url#*/} \n\ else \n\ reg="-" \n\ fi \n\ \n\ tag=${url/*:} \n\ name=${url%:*} \n\ \n\ if [[ "${tag}" == "${name}" ]] \n\ then \n\ echo "Bad tag format in URL!" \n\ return 1 \n\ fi \n\ \n\ ts=$(date -u +"%Y/%m/%d %H:%M:%S") \n\ \n\ if [[ ! -e ${ISL_FILE} ]] \n\ then \n\ id=1 \n\ else \n\ id=$(( $(wc -l <${ISL_FILE}) + 1)) \n\ fi \n\ \n\ str="${id} ${ts} ${reg} ${name} ${tag}" \n\ \n\ if [[ $id == "1" ]] \n\ then \n\ echo "${str}" >${ISL_FILE} \n\ else \n\ sed -i `1i\`"${str}" ${ISL_FILE} \n\ fi \n\ } \n\ \n\ export -f isl_add \n\ \n\ \n\ \n\ isl_top() \n\ { \n\ line=$( head -1 ${ISL_FILE}) \n\ \n\ if [[ "$1" == "-i" ]] \n\ then \n\ set ${line} \n\ \n\ echo "$5:$6" \n\ else \n\ echo "${line}" \n\ fi \n\ } \n\ \n\ export -f isl_top \n\ \n\ \n\ \n\ isl_cat() \n\ { \n\ if [[ "$1" == "-r" ]] \n\ then \n\ tac ${ISL_FILE} \n\ else \n\ cat ${ISL_FILE} \n\ fi \n\ } \n\ \n\ export -f isl_cat \n\ \n\ \n\ \n\ isl_html_dump() \n\ { \n\ r_flag="" \n\ i_flag="" \n\ \n\ while [[ $# -gt 0 ]] \n\ do \n\ if [[ "$1" == "-r" ]] \n\ then \n\ r_flag="$1" \n\ else \n\ if [[ "$1" == "-i" ]] \n\ then \n\ i_flag="-i" \n\ fi \n\ fi \n\ \n\ shift \n\ done \n\ \n\ i=1 \n\ \n\ isl_cat "${r_flag}" | while read line \n\ do \n\ set $line \n\ \n\ if [[ $(( $i % 2)) -eq 0 ]] \n\ then \n\ print "${i_flag}" `