OSDN Git Service

fix an error and edit installer
[alterlinux/plymouth-theme-alter.git] / install.sh
1 #!/bin/bash
2
3 # CHECK PERMISSION AND DIRECTORY
4 if [ ! $UID -eq 0 ]; then
5         echo "Permission denied."
6         exit 1
7 elif [ ! -d /usr/share/plymouth/themes ]; then
8         echo "Please setup plymouth."
9         exit 1
10 fi
11
12 if [ ! $1 ]; then
13         echo "Please choose theme at least one."
14         echo "Example: ~# install.sh alter-logo alter-pp"
15         exit 1
16 fi
17
18 SCRIPT_DIR=$(cd $(dirname $0); pwd)
19
20 for ((i=1; i <= $#; i++)); do
21         case ${!i} in
22
23                 # INSTALL alter-logo
24                 "alter-logo" ) \
25                 rm -rf /usr/share/plymouth/themes/alter-logo ; \
26                 mkdir /usr/share/plymouth/themes/alter-logo && \
27                 cp $SCRIPT_DIR/alter-logo/intro/* /usr/share/plymouth/themes/alter-logo/ && \
28                 cp $SCRIPT_DIR/alter-logo/loop/* /usr/share/plymouth/themes/alter-logo/ && \
29                 cp $SCRIPT_DIR/alter-logo/misc/* /usr/share/plymouth/themes/alter-logo/ && \
30                 echo "installing alter-logo ......" && plymouth-set-default-theme -R alter-logo >/dev/null 2>&1 && \
31                 echo "INSTALL alter-logo DONE !!!!" || echo "ERROR HAS OCCURRED !!" ;;
32
33                 # INSTALL alter-pp
34                 "alter-pp" ) \
35                 rm -rf /usr/share/plymouth/themes/alter-pp ; \
36                 mkdir /usr/share/plymouth/themes/alter-pp && \
37                 cp $SCRIPT_DIR/alter-pp/intro/* /usr/share/plymouth/themes/alter-pp/ && \
38                 cp $SCRIPT_DIR/alter-pp/loop/* /usr/share/plymouth/themes/alter-pp/ && \
39                 cp $SCRIPT_DIR/alter-pp/misc/* /usr/share/plymouth/themes/alter-pp/ && \
40                 echo "installing alter-pp ......" && plymouth-set-default-theme -R alter-pp >/dev/null 2>&1 && \
41                 echo "INSTALL alter-pp DONE !!!!" || echo "ERROR HAS OCCURRED !!" ;;
42
43
44         esac
45 done
46
47 exit