Initial commit

Signed-off-by: Qin Bo <bqin@linx-info.com>
This commit is contained in:
Qin Bo
2014-02-13 09:22:20 +08:00
commit 2235771f09
261 changed files with 34439 additions and 0 deletions

56
install_shell/check_function.sh Executable file
View File

@@ -0,0 +1,56 @@
#!/bin/bash
ROOT_UID=0
E_NOTROOT=4
if [ "$UID" -ne "$ROOT_UID" ]
then
echo "Must be root to run this script."
exit $E_NOTROOT
fi
check_config() {
# return value
# 0 - already set
# 1 - need to change value
# 2 - not set
path=$1
keyword=$2
value=$3
rtn=2
grep -v '^#' $path | grep -v '^$' | grep "$keyword" &>/dev/null
if [ $? -eq 0 ]; then
grep -v '^#' $path | grep -v '^$' | \
grep "$keyword" | grep "$value" &>/dev/null
rtn=$?
return $rtn
else
return $rtn
fi
}
check_konsole()
{
Home=$1
if [ ! -d $Home/Desktop ];then
mkdir -p $Home/Desktop
cp Desktop/* ${Home}/Desktop/
elif [ -d $Home/Desktop ];then
if [ ! -f $Home/Desktop/konsole.desktop ];then
cp Desktop/konsole.desktop $Home/Desktop/
fi
fi
}