-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·86 lines (68 loc) · 2.3 KB
/
install.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
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
#!/bin/bash
install_udev () {
udev_dir=/etc/udev/rules.d
udev_file=71-seat-tn.rules
install -m 644 udev/${udev_file} ${udev_dir}
udevadm control --reload-rules
udevadm trigger
}
install_xorg () {
xorg_dir=/etc/X11/xorg.conf.d
xorg_file=90-seat-sm501.conf
xorg_update_script=oi-lab-lite-update-xorg-conf
install -d ${xorg_dir}
install -m 644 xorg/${xorg_file} ${xorg_dir}
install -m 755 scripts/${xorg_update_script} /usr/local/bin
${xorg_update_script} ${xorg_dir}/${xorg_file}
}
install_lightdm () {
lightdm_dir=/etc/xdg/lightdm/lightdm.conf.d
install -d ${lightdm_dir}
install -m 644 lightdm/*.conf ${lightdm_dir}
systemctl restart lightdm
}
install_userful_rescue () {
ur_prefix="/boot/userful-rescue"
ur_file="userful-rescue-live-20160628-i386.iso"
ur_google_id='0B_0RrXAKZ1hbdnRvcGRuSFc2Nkk'
ur_google_prefix='https://drive.google.com/uc?export=download'
if ! [ -f "${ur_prefix}/${ur_file}" ]
then
(
[ -d "${ur_prefix}" ] || mkdir -p ${ur_prefix}
filename="$(curl -sc /tmp/gcookie "${ur_google_prefix}&id=${ur_google_id}" | grep -o '="uc-name.*</span>' | sed 's/.*">//;s/<.a> .*//')"
getcode="$(awk '/_warning_/ {print $NF}' /tmp/gcookie)"
curl -Lb /tmp/gcookie -C - "${ur_google_prefix}&confirm=${getcode}&id=${ur_google_id}" -o "${ur_prefix}/${ur_file}"
rm -f /tmp/gcookie
) || exit 1
fi
if [[ -x $(which update-grub) ]]
then
update-grub
else
grub2-mkconfig -o /boot/grub*/grub.cfg
fi
install -m 644 systemd/userful-rescue-* /etc/systemd/system
install -m 755 scripts/userful-rescue-{enable,disable} /usr/local/bin
install -m 755 grub/42_userful-rescue /etc/grub.d
}
install_freeze () {
pam_file=pam_mount.conf.xml
pam_dir=/etc/security
install -m 755 scripts/oi-lab-lite-freeze-* /usr/local/bin
if [[ -f ${pam_dir}/${pam_file} ]]
then
mv ${pam_dir}/${pam_file}{,.bkp}
elif [[ ! -d ${pam_dir} ]]
then
install -d ${pam_dir}
fi
install -m 644 pam/${pam_file} ${pam_dir}
install -d ${pam_dir}/limits.d
install -m 644 pam/limits.d/* ${pam_dir}/limits.d
}
install_udev
install_xorg
install_freeze
install_userful_rescue
[[ -x $(which lightdm) ]] && install_lightdm