Skip to content

Commit 243bded

Browse files
author
Nick Shorter
committed
fixed install.sh script
1 parent 4570046 commit 243bded

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

install.sh

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@ then
66
echo "Are you root?"
77
exit 2
88
fi
9-
apt update && apt upgrade -y
10-
apt install -y fonts-noto-mono
9+
apt update && apt upgrade -y && apt install -y fonts-noto-mono
10+
if [ 0 == $(echo $?) ]
11+
then
12+
echo "Error Occured While installing and updatings fonts"
13+
exit 1
14+
fi
1115

1216
mv -v $SOURCE_DIR/fonts/* /usr/share/fonts/
1317
mv -v $SOURCE_DIR/ohmyoled /usr/local/bin/
14-
if [[ -f /usr/lib/systemd/system/ohmyoled.service ]]
18+
if [ -f /usr/lib/systemd/system/ohmyoled.service ]
19+
then
1520
echo "ohmyoled service exists"
1621
else
17-
echo "Creating Systemd File"
22+
echo "Creating Systemd File for ohmyoled"
1823
cat <<EOF >> /usr/lib/systemd/system/ohmyoled.service
1924
[Unit]
2025
Description=OhMyOLED Service
@@ -27,21 +32,21 @@ WorkingDirectory=/usr/local/bin/
2732
[Install]
2833
WantedBy=multi-user.target
2934
EOF
30-
fi
31-
32-
if
35+
fi
36+
3337
ln -s /usr/lib/systemd/system/ohmyoled.service /etc/systemd/system/multi-user.target.wants/
3438
systemctl daemon-reload
3539

36-
mkdir -p /etc/ohmyoled/
37-
if [[ -f /etc/ohmyoled/ecIcons_utf8.csv ]] then
38-
echo "Icons File already Exists"
39-
else
40-
mv -v $SOURCE_DIR/ecIcons_utf8.csv /etc/ohmyoled/
41-
fi
40+
mkdir -p /etc/ohmyoled/ && mkdir -p /var/log/ohmyoled/
41+
if [ 0 == $(echo $?) ]
42+
then
43+
echo "Error Occured creating ohmyoled dirs"
44+
exit 1
45+
fi
4246

4347
echo "Created OhMyOled Config file to /etc/ohmyoled"
44-
if [[ -f /etc/ohmyoled/ohmyoled.conf ]] then
48+
if [ -f /etc/ohmyoled/ohmyoled.conf ]
49+
then
4550
echo "/etc/ohmyoled/ohmyoled.conf already exists"
4651
else
4752
mv -r $SOURCE_DIR/ohmyoled.conf /etc/ohmyoled/

0 commit comments

Comments
 (0)