rc-scripts/trunk: hwprofile lang.csh lang.sh run-parts service
setsysfont
baggins
cvs at pld-linux.org
Wed Oct 26 18:57:27 CEST 2005
Author: baggins
Date: Wed Oct 26 18:57:25 2005
New Revision: 6492
Modified:
rc-scripts/trunk/hwprofile
rc-scripts/trunk/lang.csh
rc-scripts/trunk/lang.sh
rc-scripts/trunk/run-parts
rc-scripts/trunk/service
rc-scripts/trunk/setsysfont
Log:
- more white space and formatting cleanup
Modified: rc-scripts/trunk/hwprofile
==============================================================================
--- rc-scripts/trunk/hwprofile (original)
+++ rc-scripts/trunk/hwprofile Wed Oct 26 18:57:25 2005
@@ -12,24 +12,24 @@
[ -z "${EDITOR}" ] && EDITOR=vi
if [ "$(id -u)" != "0" ]; then
- echo "Need superuser privileges. Can't continue!"
+ echo "Need superuser privileges. Can't continue!"
exit 1
fi
checkprofdir()
{
- if [ ! -d ${PROFDIR} -o ! -d ${PROFDIR}/data ]; then
- echo "${PROFDIR} or ${PROFDIR}/data not found. Can't continue!"
+ if [ ! -d ${PROFDIR} -o ! -d ${PROFDIR}/data ]; then
+ echo "${PROFDIR} or ${PROFDIR}/data not found. Can't continue!"
echo "Check /etc/sysconfig/hwprof and hwprofile -h."
- exit 1
- fi
+ exit 1
+ fi
}
myecho()
{
- if [ $QUIET -eq 0 ]; then
- echo $@
- fi
+ if [ $QUIET -eq 0 ]; then
+ echo $@
+ fi
}
showhelp()
@@ -52,284 +52,284 @@
# This function probably must be enhanced.
md5sumgen()
{
- ( \
- grep -v "MHz" /proc/cpuinfo 2> /dev/null \
- grep -v "Latency" /proc/pci 2> /dev/null \
- ) | md5sum | awk ' { gsub(/ .*$/,NIL); print $0 } '
+ ( \
+ grep -v "MHz" /proc/cpuinfo 2> /dev/null \
+ grep -v "Latency" /proc/pci 2> /dev/null \
+ ) | md5sum | awk ' { gsub(/ .*$/,NIL); print $0 } '
}
while getopts adfhlsqr: opt "$@"; do
case "$opt" in
- a)
- checkprofdir
-
- echo "Adding new profile..."
-
- if [ -f /var/run/hwprofile ]; then
- echo -n "Current profile is: "
- cat /var/run/hwprofile
- fi
-
- PROFILE=
- while [ -z "${PROFILE}" ]; do
- echo -n "Enter profile name: "
- read PROFILE
-
- if [ -f ${PROFDIR}/${PROFILE}.md5 ]; then
- echo "Profile ${PROFILE} exist. Try other name."
- PROFILE=
- fi
- done
-
- rm -rf ${PROFDIR}/${PROFILE}.* ${PROFDIR}/data/${PROFILE}/
- md5sumgen > ${PROFDIR}/${PROFILE}.md5
- LANG=C LC_ALL=C date > ${PROFDIR}/${PROFILE}.date
- mkdir -p ${PROFDIR}/data/${PROFILE}/
- chmod 700 ${PROFDIR}/data/${PROFILE}/
-
- echo -n "Enter profile description (PROFDIR/${PROFILE}.desc): "
- read DESCRIPTION
- [ -z "${DESCRIPTION}" ] && DESCRIPTION="${PROFILE}"
- echo "${DESCRIPTION}" > ${PROFDIR}/${PROFILE}.desc
- echo "Now, editor will be started and you need to enter list of files"
- echo "for this profile (later as ${EDITOR} ${PROFDIR}/${PROFILE}.files)."
- echo "Press Enter."
- read
-
- if [ -f ${PROFDIR}/files -o ! -f ${PROFDIR}/${PROFILE}.files ]; then
- cat ${PROFDIR}/files > ${PROFDIR}/${PROFILE}.files;
- fi
- ${EDITOR} ${PROFDIR}/${PROFILE}.files
-
- FILES=
- echo "Validating and copying valid files for this profile:"
- for file in $(grep -v "^#" ${PROFDIR}/${PROFILE}.files); do
- if [ ! -f ${file} -o "${file}" = "/etc/sysconfig/hwprof" ]; then
- echo "${file}: invalid, skipping"
- continue
- fi
-
- bfile=$(basename ${file})
- echo "Copying ${file} to ${PROFDIR}/data/${PROFILE}/${file}..."
- cp -dp --parents ${file} ${PROFDIR}/data/${PROFILE}/
- FILES="${file}\n${FILES}"
- done
-
- echo -e "${FILES}" > ${PROFDIR}/${PROFILE}.files
- rm -f ${PROFDIR}/${PROFILE}.*~
-
- echo "New profile ready."
- break
+ a)
+ checkprofdir
+
+ echo "Adding new profile..."
+
+ if [ -f /var/run/hwprofile ]; then
+ echo -n "Current profile is: "
+ cat /var/run/hwprofile
+ fi
+
+ PROFILE=
+ while [ -z "${PROFILE}" ]; do
+ echo -n "Enter profile name: "
+ read PROFILE
+
+ if [ -f ${PROFDIR}/${PROFILE}.md5 ]; then
+ echo "Profile ${PROFILE} exist. Try other name."
+ PROFILE=
+ fi
+ done
+
+ rm -rf ${PROFDIR}/${PROFILE}.* ${PROFDIR}/data/${PROFILE}/
+ md5sumgen > ${PROFDIR}/${PROFILE}.md5
+ LANG=C LC_ALL=C date > ${PROFDIR}/${PROFILE}.date
+ mkdir -p ${PROFDIR}/data/${PROFILE}/
+ chmod 700 ${PROFDIR}/data/${PROFILE}/
+
+ echo -n "Enter profile description (PROFDIR/${PROFILE}.desc): "
+ read DESCRIPTION
+ [ -z "${DESCRIPTION}" ] && DESCRIPTION="${PROFILE}"
+ echo "${DESCRIPTION}" > ${PROFDIR}/${PROFILE}.desc
+ echo "Now, editor will be started and you need to enter list of files"
+ echo "for this profile (later as ${EDITOR} ${PROFDIR}/${PROFILE}.files)."
+ echo "Press Enter."
+ read
+
+ if [ -f ${PROFDIR}/files -o ! -f ${PROFDIR}/${PROFILE}.files ]; then
+ cat ${PROFDIR}/files > ${PROFDIR}/${PROFILE}.files;
+ fi
+ ${EDITOR} ${PROFDIR}/${PROFILE}.files
+
+ FILES=
+ echo "Validating and copying valid files for this profile:"
+ for file in $(grep -v "^#" ${PROFDIR}/${PROFILE}.files); do
+ if [ ! -f ${file} -o "${file}" = "/etc/sysconfig/hwprof" ]; then
+ echo "${file}: invalid, skipping"
+ continue
+ fi
+
+ bfile=$(basename ${file})
+ echo "Copying ${file} to ${PROFDIR}/data/${PROFILE}/${file}..."
+ cp -dp --parents ${file} ${PROFDIR}/data/${PROFILE}/
+ FILES="${file}\n${FILES}"
+ done
+
+ echo -e "${FILES}" > ${PROFDIR}/${PROFILE}.files
+ rm -f ${PROFDIR}/${PROFILE}.*~
+
+ echo "New profile ready."
+ break
+ ;;
+ d)
+ checkprofdir
+
+ echo "Deleting existing profile..."
+
+ PROFILE=
+ while [ -z ${PROFILE} ]; do
+ echo -n "Enter profile name: "
+ read PROFILE
+
+ if [ ! -f ${PROFDIR}/${PROFILE}.md5 ]; then
+ echo "Profile ${PROFILE} doesn't exist. Try other name."
+ PROFILE=
+ fi
+ done
+
+ echo -n "Are you sure? [y/N]: "
+ read YN
+ case "${YN}" in
+ y | Y | t | T )
+ # ok
;;
- d)
- checkprofdir
-
- echo "Deleting existing profile..."
-
- PROFILE=
- while [ -z ${PROFILE} ]; do
- echo -n "Enter profile name: "
- read PROFILE
-
- if [ ! -f ${PROFDIR}/${PROFILE}.md5 ]; then
- echo "Profile ${PROFILE} doesn't exist. Try other name."
- PROFILE=
- fi
- done
-
- echo -n "Are you sure? [y/N]: "
- read YN
- case "${YN}" in
- y | Y | t | T )
- # ok
- ;;
- *)
- echo "Exiting then."
- exit 1
- ;;
- esac
-
- rm -rf ${PROFDIR}/${PROFILE}.* ${PROFDIR}/data/${PROFILE}/
- echo "Done."
- break
+ *)
+ echo "Exiting then."
+ exit 1
;;
- r)
+ esac
- checkprofdir
-
- PROFILE="${OPTARG}"
-
- if [ -z "${PROFILE}" -o ! -f ${PROFDIR}/${PROFILE}.files ]; then
- echo "Can't setup ${PROFILE}. No required data."
- exit 1
- fi
-
- echo -n "Setting up profile \"${PROFILE}\" "
- myecho "";
-
- for file in $(grep -v "^#" ${PROFDIR}/${PROFILE}.files); do
- if [ ! -f ${file} -o "${file}" = "/etc/sysconfig/hwprof" ]; then
- myecho "${file}: invalid, skipping"
- continue
- fi
- echo -n ".";
-
- myecho "Copying ${PROFDIR}/data/${PROFILE}/${file} to ${file}..."
- cp -dp ${PROFDIR}/data/${PROFILE}/${file} ${file} 2>/dev/null
- done
-
- echo ${PROFILE} > /var/run/hwprofile
- echo " Done.";
- myecho "Profile \"${PROFILE}\" running."
- break
- ;;
- f)
- checkprofdir
-
- PROFILE=
- PROFILEMD5=$(md5sumgen)
-
- myecho "Trying to find proper profile..."
- for prof in $(ls -1 ${PROFDIR}/*.md5 2> /dev/null); do
- prof=$(basename ${prof})
- CURRENTMD5="$(cat ${PROFDIR}/${prof} 2> /dev/null)"
- # echo "$prof ${CURRENTMD5} ${PROFILEMD5}";
- [ -z "${CURRENTMD5}" ] && continue
-
- if [ "${CURRENTMD5}" = "${PROFILEMD5}" ]; then
- PROFILE=$(echo ${prof} | awk ' { gsub(/\.md5/,NIL); print $0 } ')
- break;
- fi
- done
-
- if [ -z "${PROFILE}" ]; then
- if is_yes "${ASKFORPROFILE}"; then
- echo "Available profiles:";
- PS3='Enter profile number: ';
- LISTA=$(ls ${PROFDIR}/*.desc 2> /dev/null);
- for i in ${LISTA}; do
- a=$(basename $i .desc);
- LISTA1="${a} ${LISTA1}";
- done
- LISTA1="${LISTA1} Default";
-
- select PROFILE in $LISTA1; do
- if [ -n "${PROFILE}" ]; then
- break
- fi
- done
-
- if [ "${PROFILE}" = "Default" ]; then
- PROFILE=
+ rm -rf ${PROFDIR}/${PROFILE}.* ${PROFDIR}/data/${PROFILE}/
+ echo "Done."
+ break
+ ;;
+ r)
+
+ checkprofdir
+
+ PROFILE="${OPTARG}"
+
+ if [ -z "${PROFILE}" -o ! -f ${PROFDIR}/${PROFILE}.files ]; then
+ echo "Can't setup ${PROFILE}. No required data."
+ exit 1
+ fi
+
+ echo -n "Setting up profile \"${PROFILE}\" "
+ myecho "";
+
+ for file in $(grep -v "^#" ${PROFDIR}/${PROFILE}.files); do
+ if [ ! -f ${file} -o "${file}" = "/etc/sysconfig/hwprof" ]; then
+ myecho "${file}: invalid, skipping"
+ continue
+ fi
+ echo -n ".";
+
+ myecho "Copying ${PROFDIR}/data/${PROFILE}/${file} to ${file}..."
+ cp -dp ${PROFDIR}/data/${PROFILE}/${file} ${file} 2>/dev/null
+ done
+
+ echo ${PROFILE} > /var/run/hwprofile
+ echo " Done.";
+ myecho "Profile \"${PROFILE}\" running."
+ break
+ ;;
+ f)
+ checkprofdir
+
+ PROFILE=
+ PROFILEMD5=$(md5sumgen)
+
+ myecho "Trying to find proper profile..."
+ for prof in $(ls -1 ${PROFDIR}/*.md5 2> /dev/null); do
+ prof=$(basename ${prof})
+ CURRENTMD5="$(cat ${PROFDIR}/${prof} 2> /dev/null)"
+ # echo "$prof ${CURRENTMD5} ${PROFILEMD5}";
+ [ -z "${CURRENTMD5}" ] && continue
+
+ if [ "${CURRENTMD5}" = "${PROFILEMD5}" ]; then
+ PROFILE=$(echo ${prof} | awk ' { gsub(/\.md5/,NIL); print $0 } ')
+ break;
+ fi
+ done
+
+ if [ -z "${PROFILE}" ]; then
+ if is_yes "${ASKFORPROFILE}"; then
+ echo "Available profiles:";
+ PS3='Enter profile number: ';
+ LISTA=$(ls ${PROFDIR}/*.desc 2> /dev/null);
+ for i in ${LISTA}; do
+ a=$(basename $i .desc);
+ LISTA1="${a} ${LISTA1}";
+ done
+ LISTA1="${LISTA1} Default";
+
+ select PROFILE in $LISTA1; do
+ if [ -n "${PROFILE}" ]; then
+ break
fi
+ done
+
+ if [ "${PROFILE}" = "Default" ]; then
+ PROFILE=
fi
fi
+ fi
- if [ -z "${PROFILE}" ]; then
- if [ ! -f ${PROFDIR}/default.md5 ]; then
- echo "Valid profile not found. Starting with current files."
- exit 0
- else
- echo "Valid profile not found. Starting with \"default\" profile."
- PROFILE=default
- fi
+ if [ -z "${PROFILE}" ]; then
+ if [ ! -f ${PROFDIR}/default.md5 ]; then
+ echo "Valid profile not found. Starting with current files."
+ exit 0
+ else
+ echo "Valid profile not found. Starting with \"default\" profile."
+ PROFILE=default
fi
-
- if [ ! -z "${PROFILE}" ]; then
- myecho "Found profile \"${PROFILE}\" with md5sum \"${PROFILEMD5}\"."
- if [ $QUIET -eq 0 ]; then
- $0 -r ${PROFILE};
- else
- $0 -qr ${PROFILE};
- fi
+ fi
+
+ if [ ! -z "${PROFILE}" ]; then
+ myecho "Found profile \"${PROFILE}\" with md5sum \"${PROFILEMD5}\"."
+ if [ $QUIET -eq 0 ]; then
+ $0 -r ${PROFILE};
+ else
+ $0 -qr ${PROFILE};
fi
- break
- ;;
- s)
- checkprofdir
-
- PROFILE=$(cat /var/run/hwprofile 2> /dev/null)
-
- if [ -z "${PROFILE}" ]; then
- echo "No profile currenty running."
- exit 1
- fi
-
- if [ ! -f ${PROFDIR}/${PROFILE}.files ]; then
- echo "${PROFILE}.files is missing. Can't continue."
- exit 1
- fi
-
- echo -n "Saving/updating current [${PROFILE}] profile "
- md5sumgen > ${PROFDIR}/${PROFILE}.md5
- myecho "";
- for file in $(grep -v "^#" ${PROFDIR}/${PROFILE}.files); do
- echo -n ".";
-
- if [ ! -f ${file} -o "${file}" = "/etc/sysconfig/hwprof" ]; then
- myecho "${file}: invalid, skipping"
- continue
- fi
-
- myecho "Copying ${file} to ${PROFDIR}/data/${PROFILE}/${file}"
- cp -dp --parents ${file} ${PROFDIR}/data/${PROFILE}/
- done
- echo " Done."
- break
- ;;
- l)
- echo "List of configured profiles:"
-
- for prof in $(ls -1 ${PROFDIR}/*.md5 2> /dev/null); do
- prof=$(basename ${prof})
- profname=$(echo ${prof} | awk ' { gsub(/\.md5/,NIL); print $0 } ')
- echo "Name : ${profname}"
- echo -n "Desc : "
- if [ -f ${PROFDIR}/${profname}.md5 ]; then
- cat ${PROFDIR}/${profname}.desc
- else
- echo "MISSING"
- fi
- echo -n "Created : "
- if [ -f ${PROFDIR}/${profname}.date ]; then
- cat ${PROFDIR}/${profname}.date
- else
- echo "MISSING"
- fi
- echo -n "md5sum : "
- if [ -f ${PROFDIR}/${profname}.md5 ]; then
- cat ${PROFDIR}/${profname}.md5
- else
- echo "MISSING"
- fi
- echo -n "Files : "
- if [ -f ${PROFDIR}/${profname}.files ]; then
- cat ${PROFDIR}/${profname}.files | xargs
- else
- echo "MISSING"
- fi
- echo
- done
- echo "End."
- break
- ;;
- q)
- QUIET=1; export QUIET;
- ;;
- *)
- showhelp
+ fi
+ break
+ ;;
+ s)
+ checkprofdir
+
+ PROFILE=$(cat /var/run/hwprofile 2> /dev/null)
+
+ if [ -z "${PROFILE}" ]; then
+ echo "No profile currenty running."
exit 1
- break
- ;;
- esac
+ fi
+
+ if [ ! -f ${PROFDIR}/${PROFILE}.files ]; then
+ echo "${PROFILE}.files is missing. Can't continue."
+ exit 1
+ fi
+
+ echo -n "Saving/updating current [${PROFILE}] profile "
+ md5sumgen > ${PROFDIR}/${PROFILE}.md5
+ myecho "";
+ for file in $(grep -v "^#" ${PROFDIR}/${PROFILE}.files); do
+ echo -n ".";
+
+ if [ ! -f ${file} -o "${file}" = "/etc/sysconfig/hwprof" ]; then
+ myecho "${file}: invalid, skipping"
+ continue
+ fi
+
+ myecho "Copying ${file} to ${PROFDIR}/data/${PROFILE}/${file}"
+ cp -dp --parents ${file} ${PROFDIR}/data/${PROFILE}/
+ done
+ echo " Done."
+ break
+ ;;
+ l)
+ echo "List of configured profiles:"
+
+ for prof in $(ls -1 ${PROFDIR}/*.md5 2> /dev/null); do
+ prof=$(basename ${prof})
+ profname=$(echo ${prof} | awk ' { gsub(/\.md5/,NIL); print $0 } ')
+ echo "Name : ${profname}"
+ echo -n "Desc : "
+ if [ -f ${PROFDIR}/${profname}.md5 ]; then
+ cat ${PROFDIR}/${profname}.desc
+ else
+ echo "MISSING"
+ fi
+ echo -n "Created : "
+ if [ -f ${PROFDIR}/${profname}.date ]; then
+ cat ${PROFDIR}/${profname}.date
+ else
+ echo "MISSING"
+ fi
+ echo -n "md5sum : "
+ if [ -f ${PROFDIR}/${profname}.md5 ]; then
+ cat ${PROFDIR}/${profname}.md5
+ else
+ echo "MISSING"
+ fi
+ echo -n "Files : "
+ if [ -f ${PROFDIR}/${profname}.files ]; then
+ cat ${PROFDIR}/${profname}.files | xargs
+ else
+ echo "MISSING"
+ fi
+ echo
+ done
+ echo "End."
+ break
+ ;;
+ q)
+ QUIET=1; export QUIET;
+ ;;
+ *)
+ showhelp
+ exit 1
+ break
+ ;;
+ esac
done
if [ "$#" -le "0" -o "$OPTIND" -eq 1 ]; then
- showhelp
- exit 1
+ showhelp
+ exit 1
fi
exit 0
# This must be last line !
-# vi:syntax=sh:ts=2:sw=2
+# vi:syntax=sh
Modified: rc-scripts/trunk/lang.csh
==============================================================================
--- rc-scripts/trunk/lang.csh (original)
+++ rc-scripts/trunk/lang.csh Wed Oct 26 18:57:25 2005
@@ -5,35 +5,30 @@
test -f /etc/sysconfig/i18n
if ($status == 0) then
-
- if ($?LANG) then
- setenv LANG
- endif
-
- if ($?LC_ALL) then
- setenv LC_ALL
- endif
-
- if ($?LINGUAS) then
- setenv LINGUAS
- endif
-
- if ($?SYSTERM) then
- setenv TERM=$SYSTERM
- endif
-
- if ($?_XKB_CHARSET) then
- setenv _XKB_CHARSET
- endif
-
- if ($?INPUTRC) then
- setenv INPUTRC
- endif
-
- if ($?LESSCHARSET) then
- setenv LESSCHARSET
- else if ($TERM == linux-lat) then
- setenv LESSCHARSET latin1
- endif
-
+ if ($?LANG) then
+ setenv LANG
+ endif
+ if ($?LC_ALL) then
+ setenv LC_ALL
+ endif
+ if ($?LINGUAS) then
+ setenv LINGUAS
+ endif
+ if ($?SYSTERM) then
+ setenv TERM=$SYSTERM
+ endif
+ if ($?_XKB_CHARSET) then
+ setenv _XKB_CHARSET
+ endif
+ if ($?INPUTRC) then
+ setenv INPUTRC
+ endif
+ if ($?LESSCHARSET) then
+ setenv LESSCHARSET
+ else if ($TERM == linux-lat) then
+ setenv LESSCHARSET latin1
+ endif
endif
+
+# This must be last line !
+# vi:syntax=csh
Modified: rc-scripts/trunk/lang.sh
==============================================================================
--- rc-scripts/trunk/lang.sh (original)
+++ rc-scripts/trunk/lang.sh Wed Oct 26 18:57:25 2005
@@ -4,34 +4,37 @@
#
if [ -f /etc/sysconfig/i18n ]; then
- . /etc/sysconfig/i18n
+ . /etc/sysconfig/i18n
- [ -n "$LANG" ] && export LANG || unset LANG
- [ -n "$LC_CTYPE" ] && export LC_CTYPE || unset LC_CTYPE
- [ -n "$LC_COLLATE" ] && export LC_COLLATE || unset LC_COLLATE
- [ -n "$LC_MESSAGES" ] && export LC_MESSAGES || unset LC_MESSAGES
- [ -n "$LC_NUMERIC" ] && export LC_NUMERIC || unset LC_NUMERIC
- [ -n "$LC_MONETARY" ] && export LC_MONETARY || unset LC_MONETARY
- [ -n "$LC_TIME" ] && export LC_TIME || unset LC_TIME
- [ -n "$LC_ALL" ] && export LC_ALL || unset LC_ALL
- [ -n "$LANGUAGE" ] && export LANGUAGE || unset LANGUAGE
- [ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS
-
- [ -n "$_XKB_CHARSET" ] && export _XKB_CHARSET || unset _XKB_CHARSET
-
- # deprecated
- if [ -n "$SYSTERM" ]; then
- export TERM=$SYSTERM
- fi
-
- if [ -n "$INPUTRC" ]; then
- export INPUTRC
- fi
-
- if [ -n "$LESSCHARSET" ]; then
- export LESSCHARSET
- elif [ "$TERM" = "linux-lat" ]; then
- LESSCHARSET=latin1
- export LESSCHARSET
- fi
+ [ -n "$LANG" ] && export LANG || unset LANG
+ [ -n "$LC_CTYPE" ] && export LC_CTYPE || unset LC_CTYPE
+ [ -n "$LC_COLLATE" ] && export LC_COLLATE || unset LC_COLLATE
+ [ -n "$LC_MESSAGES" ] && export LC_MESSAGES || unset LC_MESSAGES
+ [ -n "$LC_NUMERIC" ] && export LC_NUMERIC || unset LC_NUMERIC
+ [ -n "$LC_MONETARY" ] && export LC_MONETARY || unset LC_MONETARY
+ [ -n "$LC_TIME" ] && export LC_TIME || unset LC_TIME
+ [ -n "$LC_ALL" ] && export LC_ALL || unset LC_ALL
+ [ -n "$LANGUAGE" ] && export LANGUAGE || unset LANGUAGE
+ [ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS
+
+ [ -n "$_XKB_CHARSET" ] && export _XKB_CHARSET || unset _XKB_CHARSET
+
+ # deprecated
+ if [ -n "$SYSTERM" ]; then
+ export TERM=$SYSTERM
+ fi
+
+ if [ -n "$INPUTRC" ]; then
+ export INPUTRC
+ fi
+
+ if [ -n "$LESSCHARSET" ]; then
+ export LESSCHARSET
+ elif [ "$TERM" = "linux-lat" ]; then
+ LESSCHARSET=latin1
+ export LESSCHARSET
+ fi
fi
+
+# This must be last line !
+# vi:syntax=sh
Modified: rc-scripts/trunk/run-parts
==============================================================================
--- rc-scripts/trunk/run-parts (original)
+++ rc-scripts/trunk/run-parts Wed Oct 26 18:57:25 2005
@@ -18,7 +18,7 @@
if [ "$1" = "-u" ]; then
workasuser=yes
shift
-fi
+fi
# std checks
if [ $# -lt 1 ]; then
@@ -50,28 +50,31 @@
# Ignore *~ and *, scripts
for i in $RUNPARTS_DIR/*[!~,] ; do
- [ -d "$i" ] && continue
- # Don't run *.{rpmsave,rpmorig,rpmnew,swp} scripts
- [ "${i%.rpmsave}" != "${i}" ] && continue
- [ "${i%.rpmorig}" != "${i}" ] && continue
- [ "${i%.rpmnew}" != "${i}" ] && continue
- [ "${i%.swp}" != "${i}" ] && continue
- [ "${i%,v}" != "${i}" ] && continue
-
- if [ -x "$i" ]; then
- runprog="$i $@"
- if [ "$workasuser" = "yes" ]; then
- runuser="$(/bin/ls -l "$i" | awk ' { print $3 } ' 2> /dev/null)"
- [ -z "$runuser" ] && echo "Warning: Can't find owner for [$i] file. Not running." && continue
- runprog="/bin/su $runuser -s /bin/sh -c $runprog"
- fi
- $runprog 2>&1 | awk -v "progname=$i" \
- 'progname {
- print progname ":\n"
- progname="";
- }
- { print; }'
- fi
+ [ -d "$i" ] && continue
+ # Don't run *.{rpmsave,rpmorig,rpmnew,swp} scripts
+ [ "${i%.rpmsave}" != "${i}" ] && continue
+ [ "${i%.rpmorig}" != "${i}" ] && continue
+ [ "${i%.rpmnew}" != "${i}" ] && continue
+ [ "${i%.swp}" != "${i}" ] && continue
+ [ "${i%,v}" != "${i}" ] && continue
+
+ if [ -x "$i" ]; then
+ runprog="$i $@"
+ if [ "$workasuser" = "yes" ]; then
+ runuser="$(/bin/ls -l "$i" | awk ' { print $3 } ' 2> /dev/null)"
+ [ -z "$runuser" ] && echo "Warning: Can't find owner for [$i] file. Not running." && continue
+ runprog="/bin/su $runuser -s /bin/sh -c $runprog"
+ fi
+ $runprog 2>&1 | awk -v "progname=$i" \
+ 'progname {
+ print progname ":\n"
+ progname="";
+ }
+ { print; }'
+ fi
done
exit 0
+
+# This must be last line !
+# vi:syntax=sh
Modified: rc-scripts/trunk/service
==============================================================================
--- rc-scripts/trunk/service (original)
+++ rc-scripts/trunk/service Wed Oct 26 18:57:25 2005
@@ -11,63 +11,66 @@
SERVICE=
if [ -d /etc/rc.d/init.d ]; then
- SERVICEDIR="/etc/rc.d/init.d"
+ SERVICEDIR="/etc/rc.d/init.d"
else
- SERVICEDIR="/etc/init.d"
+ SERVICEDIR="/etc/init.d"
fi
if [ $# -eq 0 ]; then
- echo "${USAGE}" >&2
- exit 1
+ echo "${USAGE}" >&2
+ exit 1
fi
cd /
while [ $# -gt 0 ]; do
- case "${1}" in
- --help | -h | --h* )
- echo "${USAGE}" >&2
- exit 0
- ;;
- --version | -V )
- echo "${VERSION}" >&2
- exit 0
- ;;
- *)
- if [ -z "${SERVICE}" -a $# -eq 1 -a "${1}" = "--status-all" ]; then
- cd ${SERVICEDIR}
- for SERVICE in * ; do
- case "${SERVICE}" in
- functions | halt | killall | single| linuxconf| kudzu | \
- *rpmorig | *rpmnew | *rpmsave | *~ | *.orig)
- ;;
- *)
- if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
- env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" status
- fi
- ;;
- esac
- done
- exit 0
- elif [ $# -eq 2 -a "${2}" = "--full-restart" ]; then
- SERVICE="${1}"
- if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
- env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" stop
- env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" start
- exit $?
- fi
- elif [ -z "${SERVICE}" ]; then
- SERVICE="${1}"
- else
- OPTIONS="${OPTIONS} ${1}"
- fi
- shift
- ;;
- esac
+ case "${1}" in
+ --help | -h | --h* )
+ echo "${USAGE}" >&2
+ exit 0
+ ;;
+ --version | -V )
+ echo "${VERSION}" >&2
+ exit 0
+ ;;
+ *)
+ if [ -z "${SERVICE}" -a $# -eq 1 -a "${1}" = "--status-all" ]; then
+ cd ${SERVICEDIR}
+ for SERVICE in * ; do
+ case "${SERVICE}" in
+ functions | halt | killall | single| linuxconf| kudzu | \
+ *rpmorig | *rpmnew | *rpmsave | *~ | *.orig)
+ ;;
+ *)
+ if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
+ env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" status
+ fi
+ ;;
+ esac
+ done
+ exit 0
+ elif [ $# -eq 2 -a "${2}" = "--full-restart" ]; then
+ SERVICE="${1}"
+ if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
+ env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" stop
+ env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" start
+ exit $?
+ fi
+ elif [ -z "${SERVICE}" ]; then
+ SERVICE="${1}"
+ else
+ OPTIONS="${OPTIONS} ${1}"
+ fi
+ shift
+ ;;
+ esac
done
if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
- env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" ${OPTIONS}
+ env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" ${OPTIONS}
else
- echo "${SERVICE}: unrecognized service" >&2
- exit 1
+ echo "${SERVICE}: unrecognized service" >&2
+ exit 1
fi
+
+# This must be last line !
+# vi:syntax=sh
Modified: rc-scripts/trunk/setsysfont
==============================================================================
--- rc-scripts/trunk/setsysfont (original)
+++ rc-scripts/trunk/setsysfont Wed Oct 26 18:57:25 2005
@@ -9,11 +9,11 @@
[ -n "$SYSFONT" ] && CONSOLEFONT="$SYSFONT"
case "$LANG" in
- *.utf8|*.UTF-8)
- if [ -x /bin/unicode_start ] && /sbin/consoletype fg ; then
- exec unicode_start $CONSOLEFONT $CONSOLEMAP
- fi
- ;;
+ *.utf8|*.UTF-8)
+ if [ -x /bin/unicode_start ] && /sbin/consoletype fg ; then
+ exec unicode_start $CONSOLEFONT $CONSOLEMAP
+ fi
+ ;;
esac
# console-tools, obsolete part
@@ -24,15 +24,13 @@
if [ -n "$KEYTABLE" ]; then
loadkeys $KEYTABLE < /dev/tty0 > /dev/tty0
fi
-
-
# kbd, currently used
elif [ -x /usr/bin/setfont -o -x /bin/setfont ]; then
- if [ -n "$CONSOLESCREENFONTMAP" ]; then
+ if [ -n "$CONSOLESCREENFONTMAP" ]; then
ARGS="-u $CONSOLESCREENFONTMAP"
fi
if [ -n "$CONSOLEMAP" ]; then
- if [ ! -f /lib/kbd/consoletrans/$CONSOLEMAP_to_uni.trans ]; then
+ if [ ! -f /lib/kbd/consoletrans/$CONSOLEMAP_to_uni.trans ]; then
CONSOLEMAP=$(echo "$CONSOLEMAP" | sed "s|iso0|8859-|g;s|iso|8859-|g")
fi
ARGS="$ARGS -m $CONSOLEMAP"
@@ -40,9 +38,12 @@
if [ -n "$CONSOLEFONT" ]; then
setfont $CONSOLEFONT $ARGS
else
- echo -ne "\033(K" 2>/dev/null > /proc/$$/fd/0
+ echo -ne "\033(K" 2>/dev/null > /proc/$$/fd/0
fi
else
echo "can't set font"
exit 1
fi
+
+# This must be last line !
+# vi:syntax=sh
More information about the pld-cvs-commit
mailing list