-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
47 lines (40 loc) · 1.18 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
#!/bin/bash
# Author: Paweł 'felixd' Wojciechowski (c) FlameIT - 2022
MNT_DIR="/mnt/1wire/"
# Enable I2C on RaspberryPi
echo ""
echo "####### FlameIT #######"
echo "Making sure I2C is enabled on RaspberryPi"
echo "####### ------- #######"
sudo raspi-config nonint do_i2c 0
# Install OWFS
echo ""
echo "####### FlameIT #######"
echo "Installing OWFS"
echo "####### ------- #######"
sudo apt update && sudo apt upgrade -y
sudo apt install owfs -y
# Checking OWFS mount point
echo ""
echo "####### FlameIT #######"
echo "Checking for MNT_DIR directory"
echo "####### ------- #######"
if [ -d "$MNT_DIR" ]; then
### Take action if $MNT_DIR exists ###
echo "1-Wire mounting directory exists ${DIR}."
else
### Control will jump here if $DIR does NOT exists ###
echo "1-Wire mounting directory does not exist: ${DIR}. Creating it."
fi
echo ""
echo "####### FlameIT #######"
echo "Installing owfs.conf file in /etc/"
echo "####### ------- #######"
sudo cp owfs.conf /etc/owfs.conf
echo ""
echo "####### FlameIT #######"
echo "Restarting OWFS services (owserver, owhttpd, owftpd)"
echo "####### ------- #######"
sudo service owserver restart
sudo service owhttpd restart
sudo service owftpd restart