大连Linux/Unix高端就业、认证培训的领导者。
分类: LINUX
2008-05-16 18:11:04
chinaunix网友2008-05-17 18:04:25
ERRFILE=httpd-2.2.3-6.315 if [ -e $ERRFILE ] then rpm -e httpd-2.2.3-6.e15 else bao=/root/home/shell/httpd-2.2.3-6.e15.i386.rpm if [ -r $bao ] then rpm -ivh /root/home/shell/httpd-2.2.3-6.e15.i386.rpm fi fi
chinaunix网友2008-05-16 18:17:12
#!/bin/bash if [ "$#" -lt 1 -o "$#" -gt 3 ] then echo "Usage: ./install_apache_script.sh [source_dir] [dest_dir] for install" echo "Usage: ./install_apache_script.sh [_clean] for delete" exit fi if [ -d "$2" ] && [ -d "$1" ] then opt=_install elif [ $# -eq 1 ] && [ "$1" = "_clean" ] then opt=_clean fi case $opt in _install) if [ -e "$2/apache" ] then cp -r "$2/apache" "$2/apache$$.bak" rm -rf "$2/apache" else