forked from Feminist-Software-Foundation/Muzei-Bash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-linmuzei.sh
executable file
·48 lines (38 loc) · 1.33 KB
/
install-linmuzei.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
#!/usr/bin/env bash
# Install script for linmuzei.
# Copyright (C) 2014 Alp Pirli
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://gnu.org/licenses/>.
pack=(jq sed curl)
for p in $pack
do
if [ ! "$(which $p)" ]
then
echo "You need to install $p to use linmuzei."
exit
fi
done
if [ "$(id -u)" == "0" ]
then
echo "WARNING: If you run the install script as root the cronjob will probably not work for your user."
fi
mkdir -p ~/Pictures/Muzei
cp ./MuzeiLogo.png ~/Pictures/Muzei
read -r -p "Install linmuzei? [Y/n] " y_or_n
case $y_or_n in
[nN][oO]|[nN]) echo "Exiting." ; exit ;;
esac
[ $({ crontab -l; echo "0 * * * * DISPLAY=:0 muzeibash"; } | crontab -) ]
sudo bash << EOF
cp ./linmuzei.sh /usr/bin/linmuzei
chmod +x /usr/bin/linmuzei
echo "linmuzei installed."
EOF