-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathsystem_config.sh
executable file
·41 lines (38 loc) · 1.43 KB
/
system_config.sh
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
#!/bin/bash
version=`lsb_release -r | awk -F ' ' '{printf $NF}'`
if [ $(getconf WORD_BIT) = '32' ] && [ $(getconf LONG_BIT) = '64' ] ; then
hardware_arch=64
else
hardware_arch=32
fi
if [[ "$version" < "20.04" ]]; then
if [ $hardware_arch -eq 32 ]; then
sudo cp -rf ./boot/config-nomal.txt ./boot/config.txt.bak
elif [ $hardware_arch -eq 64 ]; then
sudo cp -rf ./boot/config-nomal-64.txt ./boot/config.txt.bak
fi
elif [[ "$version" = "20.04" ]]; then
if [ $hardware_arch -eq 32 ]; then
sudo cp -rf ./boot/config-nomal-20.04.txt ./boot/config.txt.bak
elif [ $hardware_arch -eq 64 ]; then
sudo cp -rf ./boot/config-nomal-20.04-64.txt ./boot/config.txt.bak
fi
elif [[ "$version" = "20.10" ]]; then
if [ $hardware_arch -eq 32 ]; then
sudo cp -rf ./boot/config-nomal-20.10-32.txt ./boot/config.txt.bak
elif [ $hardware_arch -eq 64 ]; then
sudo cp -rf ./boot/config-nomal-20.10-64.txt ./boot/config.txt.bak
fi
elif [[ "$version" > "20.10" ]] && [[ "$version" < "22.04" ]]; then
if [ $hardware_arch -eq 32 ]; then
sudo cp -rf ./boot/config-nomal-20.10-32.txt ./boot/config.txt.bak
elif [ $hardware_arch -eq 64 ]; then
sudo cp -rf ./boot/config-nomal-20.10-64.txt ./boot/config.txt.bak
fi
elif [[ "$version" = "22.04" ]] || [[ "$version" > "22.04" ]]; then
if [ $hardware_arch -eq 32 ]; then
sudo cp -rf ./boot/config-nomal-22.04-32.txt ./boot/config.txt.bak
elif [ $hardware_arch -eq 64 ]; then
sudo cp -rf ./boot/config-nomal-22.04-64.txt ./boot/config.txt.bak
fi
fi