exit $1
}
+function startswithmm() {
+ if [ "${1##--*}" == "" ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+function containsequals() {
+ if [ "${1//*=*}" == "" ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
argcommand=""
for option in $@; do
- if [[ ! $option =~ ^-- ]]; then
+ if ( ! startswithmm $option ); then
if [ "x$argcommand" == "xinstall-root" ]; then
InstallRoot=$option
elif [ "x$argcommand" == "xrpm-archives" ]; then
fi
fi
else
- if [[ $option =~ [=] ]]; then
+ if ( containsequals $option ); then
argcommand=${option%%=*}
argcommand=${argcommand##--}
option=${option##*=}
read -p "Remove cache directory ($ourcachedirectory)? [Yn]: " cleanup
-if [[ $cleanup =~ ^[Nn] ]]; then
+cleanup=${cleanup:0:1}
+
+if [ "$cleanup" == "N" ] || [ "$cleanup" == "n" ] ; then
echo leaving logs in $ourcachedirectory
else
echo removing logs directory