summarylogtreecommitdiffstats
path: root/cs2d.install
blob: e0ef07add7a43f7b76fdc9d50c1aa362d76427ee (plain)
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
84
85
86

post_install() {
  lang=$(echo $LANG | cut -d_ -f1)

  case "$lang" in
    zh)
      echo "您可以在 /opt/cs2d/sys/*.cfg 中更改所有设置。"
      echo "您需要加入 games 组才能拥有写入权限。"
      echo "例如执行 “sudo usermod -aG games 你的用户名”"
      ;;
    *)
      echo "You can change all settings in '/opt/cs2d/sys/*.cfg'."
      echo "And you have to be in the 'games' group to gain write access."
      echo "For example, runs 'sudo usermod -aG games YourUserName'"
      ;;
  esac
}

# pre_remove() {
#   lang=$(echo $LANG | cut -d_ -f1)
#
#   while true; do
#     case "$lang" in
#       zh)
#         echo "是否要彻底移除所有玩家数据?(N/y)"
#         ;;
#       *)
#         echo "Remove all player data for this game? (N/y)"
#         ;;
#     esac
#
#     read -r user_input
#
#     if [[ -z "$user_input" ]]; then
#         user_input="N"
#     fi
#
#     case $user_input in
#         [Yy])
#             rm -r /opt/cs2d
#             break
#             ;;
#         [Nn])
#             break
#             ;;
#         *)
#             ;;
#     esac
#   done
# }
#
# post_upgrade() {
#   lang=$(echo $LANG | cut -d_ -f1)
#
#   while true; do
#     case "$lang" in
#       zh)
#         echo "是否要恢复之前的玩家数据?(Y/n)"
#         ;;
#       *)
#         echo "Remove all player data for this game? (Y/n)"
#         ;;
#     esac
#
#     read -r user_input
#
#     if [[ -z "$user_input" ]]; then
#         user_input="Y"
#     fi
#
#     case $user_input in
#         [Yy])
#             find "/opt/cs2d" -type f -name "*.pacnew" | while read -r pacnew_file; do
#                 original_file="${pacnew_file%.pacnew}"
#                 mv -f "$pacnew_file" "$original_file"
#               done
#             break
#             ;;
#         [Nn])
#             break
#             ;;
#         *)
#             ;;
#     esac
#   done
# }