#!/bin/sh
path=
/server/scripts
[ ! -d
"$path"
] &&
mkdir
$path
#menu
cat
<<END
1.[
install
lamp]
2.[
install
lnmp]
3.[
exit
]
pls input the num you want:
END
read
num
expr
$num + 1 &>
/dev/null
[ $? -
ne
0 ] && {
echo
"the num you input must be {1|2|3}"
exit
1
}
[ $num -
eq
1 ] && {
echo
"start installing lamp."
sleep
2;
[ -x
"$path/lamp.sh"
] || {
echo
"$path/lamp.sh does not exist or can not be exec."
exit
1
}
$path
/lamp
.sh
exit
$?
}
[ $num -
eq
2 ] && {
echo
"start installing LNMP."
sleep
2;
[ -x
"$path/lnmp.sh"
] || {
echo
"$path/lnmp.sh does not exist or can not be exec."
exit
1
}
$path
/lnmp
.sh
exit
$?
}
[ $num -
eq
3 ] && {
echo
bye.
exit
3
}
#[[ ! $num =~ [1-3] ]]&&{
[ ! $num -
eq
1 -o ! $num -
eq
2 -o ! $num -
eq
3 ] && {
echo
"the num you input must be {1|2|3}"
echo
"Input ERROR"
exit
4
}