-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate
52 lines (44 loc) · 1.35 KB
/
update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /bin/sh
#2018年1月30日15:00写
#原来就三行
#结果对它的运行结果不太满意,于是并便改造了一下。
#在网上百度了一下if的用法和脚本的参数
#写出了我的第一个具有完整功能的shell脚本
if [ "$#" -eq "1" ];then
if [ "$1" == "--no-reboot" ];then
yum update kernel -y
yum update -y
else if [ "$1" == "--normal" ];then
yum update kernel -y
yum update -y
init 6
else if [ "$1" == "--help" ];then
echo " help"
echo " --normal :Update and reboot."
echo " --no-reboot :Update but Don't reboot."
echo " --help :Get help"
echo " --about :About this Program."
else if [ "$1" == "--about" ];then
echo " Update Helper"
echo " Version 1.0"
echo " Made by Mr. Lv"
echo " Compliance with the GPL V3 protocol."
echo " http://www.gnu.org/licenses/gpl.txt"
else
echo " help"
echo " --normal :Update and reboot."
echo " --no-reboot :Update but Don't reboot."
echo " --help :Get help"
echo " --about :About this Program."
fi
fi
fi
fi
else
echo " Usage:"
#echo " update --no-reboot"
#echo " update --normal"
#echo " update --help"
echo " update --[Option]"
echo " E.g:update --help"
fi