-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
executable file
·51 lines (35 loc) · 885 Bytes
/
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
#!/bin/bash
if [ "$(id -u)" -ne 0 ]; then
echo -e "\n\e[38;5;9mError: need use sudo.\e[0m\n"
exit 1
fi
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
[ ! -e "/home/share/bin" ] && mkdir -p /home/share/bin
chmod a+x ./*
for i in ./*
do
if [ "$i" = "./install.sh" ] || [ "$i" = "./LICENSE" ] ; then
continue
fi
cp -v "$i" /home/share/bin
done
echo 'export PATH="$PATH:/home/share/bin"' > /etc/profile.d/share_bin.sh
chown root:root /home/share/bin -R
echo '[Unit]
Description=kick idle sessions (15min)
[Service]
Type=oneshot
ExecStart=/bin/bash --login /home/share/bin/idle-kick
Restart=no
User=root
' > /lib/systemd/system/kick-idle.service
echo '[Unit]
Description=15min timer
[Timer]
OnBootSec=0min
OnUnitActiveSec=15min
[Install]
WantedBy=basic.target
' > /lib/systemd/system/kick-idle.timer
systemctl daemon-reload
systemctl disable --now kick-idle.timer