-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtos
executable file
·85 lines (77 loc) · 2.53 KB
/
tos
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/sh
# ===================================================
# Copyright (c) [2020-2022] [Tencent]
# [OpenCloudOS Tools] is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# ===================================================
#
# Tos command
# g_CAPD_SRDC_OS@tencent.com
#
. /usr/lib/opencloudos-tools/tos-lib.sh
scriptversion=4.0;
scriptdate=2022-03-25;
usage="\
tos version $scriptversion
Usage:
tos OpenCloudOS System Management Toolset
tos -u|-U| update [rpm_name] Update the system
tos -i|-I| install rpm_name install rpms
tos -s|-S| show Show the system version
tos -c|-C| check [rpm_name] Check the modified rpms
tos -a|-A | analyze Analyze the system performance
tos set irq Set irqaffinity, restart irqaffinity service
tos -cu| check-update Check available package updates
tos -ch| check-health [ -o OUTPUT_PATH ] Check system health status
tos -b|-B| backup [ reboot ] Backup the system online, or reboot to backup
tos -r|-R| recover|reinstall Recover or Reinstall the system
tos -h|-H| help Show this usage
tos -v|-V| version Show the script version
"
if [ $# -eq 0 ]; then
echo "$usage"
tos_show;
fi
while test $# -ne 0; do
case $1 in
-u | -U | update) shift
tos_update $@
break;;
-i | -I | install) shift
tos_install $@
break;;
-s | -S | show)
tos_show;;
-a | -A | analyze)
tos_analyze $2
break;;
-b | -B | backup)
tos_backup $2
break;;
-r | -R | recover | reinstall) shift
tos_recover $@
break;;
-c | -C | check) tos_check $2
shift;;
-cu | check-update) tos_check_update;;
-ch | check-health) shift
tos_check_health $@
break;;
-f | fix) tos_fix $2
shift;;
set) tos_set $2
shift;;
-h | -H | help) echo "$usage"; exit $?;;
-v | -V | version) echo "$scriptversion";;
--) shift
break;;
*) echo "$0: invalid option: $1" >&2
echo "$usage"
exit 1;;
esac
shift
done