目录安装:
#!/bin/sh
path=/server/scrips
[ ! -d "$path" ] && mkdir $path -p
#menu
cat <<END
.[install lamp]
.[install lnmp]
.[exit]
pls input the num you wang:
END
read num
expr $num + &>/dev/null
if [ $? -ne ];then
echo "the num you input must be {1|2|3}"
exit
fi
[ $num -eq ]&&{
echo "start install lamp."
sleep ;
[ -x "$path/lamp.sh" ]||{
echo " does not exist or can not be exec."
exit
}
$path/lamp.sh
#source $path/lamp.sh
exit $?
}
if [ $num -eq ];then
echo "start install lnmp."
sleep ;
if [ -x "$path/lamp.sh" ];then
$path/lnmp.sh
#source $path/lamp.sh
exit $?
else
echo " does not exist or can not be exec. "
exit
fi
fi
if [ $num -eq ];then
echo bye
exit
fi
[[ ! $num =~[-] ]] &&{
echo "the num you input must be {1|2|3}"
echo "Input ERROR"
exit
}