Skip to content

Commit

Permalink
fix: remove dist codename from config filenames
Browse files Browse the repository at this point in the history
removed obsolete files
  • Loading branch information
AlvinSchiller committed Apr 3, 2024
1 parent 84b901c commit 7bd8e9d
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 41 deletions.
4 changes: 2 additions & 2 deletions components/smart-home-automation/MQTT-protocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ components/smart-home-automation/MQTT-protocol/
## Auto-Starting the daemon at bootup

* The daemon is run by executing the script `daemon_mqtt_client.py` which will run in an endless loop.
* There's a sample service file (`phoniebox-mqtt-client.service.stretch-default.sample`) that can be used to register the daemon to be run at bootup.
* There's a sample service file (`phoniebox-mqtt-client.service-default.sample`) that can be used to register the daemon to be run at bootup.
* It is currently not integrated into the one-line-install script so please run the following commands to do it manually.

First step: copy files to destination locations:

~~~bash
# First copy the daemon script and service config file to the correct directory:
sudo cp /home/pi/RPi-Jukebox-RFID/components/smart-home-automation/MQTT-protocol/daemon_mqtt_client.py /home/pi/RPi-Jukebox-RFID/scripts/
sudo cp /home/pi/RPi-Jukebox-RFID/components/smart-home-automation/MQTT-protocol/phoniebox-mqtt-client.service.stretch-default.sample /etc/systemd/system/phoniebox-mqtt-client.service
sudo cp /home/pi/RPi-Jukebox-RFID/components/smart-home-automation/MQTT-protocol/phoniebox-mqtt-client.service-default.sample /etc/systemd/system/phoniebox-mqtt-client.service
# make sure the file exists
touch /home/pi/RPi-Jukebox-RFID/settings/Latest_RFID
~~~
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion misc/sampleconfigs/deviceName.txt.stretch-default.sample

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

This file was deleted.

File renamed without changes.
18 changes: 9 additions & 9 deletions ...pleconfigs/smb.conf.buster-default.sample → misc/sampleconfigs/smb.conf-default.sample
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
Expand All @@ -16,8 +16,8 @@
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
# "testparm" to check that you have not made any basic syntactic
# errors.

#======================= Global Settings =======================

Expand Down Expand Up @@ -66,7 +66,7 @@
# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
# directory domain controller".
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
Expand Down Expand Up @@ -101,7 +101,7 @@
#
# The following settings only takes effect if 'server role = primary
# classic domain controller', 'server role = backup domain controller'
# or 'domain logons' is set
# or 'domain logons' is set
#

# It specifies the location of the user's
Expand Down Expand Up @@ -130,13 +130,13 @@
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a "machines" group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
# RPC pipe.
; add group script = /usr/sbin/addgroup --force-badname %g

############ Misc ############
Expand Down Expand Up @@ -220,7 +220,7 @@
create mask=0777
directory mask=0777
public=no

# if the audiofiles are not in 'shared', we need this
[phoniebox_audiofile]
comment= Pi Jukebox
Expand Down
File renamed without changes.
22 changes: 9 additions & 13 deletions scripts/installscripts/install-jukebox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ samba_config() {
echo "Configuring Samba..."
# Samba configuration settings
# -rw-r--r-- 1 root root 9416 Apr 30 09:02 /etc/samba/smb.conf
sudo cp "${jukebox_dir}"/misc/sampleconfigs/smb.conf.buster-default.sample ${smb_conf}
sudo cp "${jukebox_dir}"/misc/sampleconfigs/smb.conf-default.sample ${smb_conf}
sudo chown root:root "${smb_conf}"
sudo chmod 644 "${smb_conf}"
# for $DIRaudioFolders using | as alternate regex delimiter because of the folder path slash
Expand All @@ -808,27 +808,27 @@ web_server_config() {
sudo chmod o+x ${HOME_DIR}
# Web server configuration settings
# -rw-r--r-- 1 root root 1040 Apr 30 09:19 /etc/lighttpd/lighttpd.conf
sudo cp "${jukebox_dir}"/misc/sampleconfigs/lighttpd.conf.buster-default.sample "${lighthttpd_conf}"
sudo cp "${jukebox_dir}"/misc/sampleconfigs/lighttpd.conf-default.sample "${lighthttpd_conf}"
sudo chown root:root "${lighthttpd_conf}"
sudo chmod 644 "${lighthttpd_conf}"
# double quotes for variable expansion
sudo sed -i "s%/home/pi%${HOME_DIR}%g" "${lighthttpd_conf}"

# Web server PHP7 fastcgi conf
# -rw-r--r-- 1 root root 398 Apr 30 09:35 /etc/lighttpd/conf-available/15-fastcgi-php.conf
sudo cp "${jukebox_dir}"/misc/sampleconfigs/15-fastcgi-php.conf.buster-default.sample ${fastcgi_php_conf}
sudo cp "${jukebox_dir}"/misc/sampleconfigs/15-fastcgi-php.conf-default.sample ${fastcgi_php_conf}
sudo chown root:root "${fastcgi_php_conf}"
sudo chmod 644 "${fastcgi_php_conf}"

# settings for php.ini to support upload
# -rw-r--r-- 1 root root 70999 Jun 14 13:50 /etc/php/7.3/cgi/php.ini
sudo cp "${jukebox_dir}"/misc/sampleconfigs/php.ini.buster-default.sample ${php_ini}
sudo cp "${jukebox_dir}"/misc/sampleconfigs/php.ini-default.sample ${php_ini}
sudo chown root:root "${php_ini}"
sudo chmod 644 "${php_ini}"

# SUDO users (adding web server here)
# -r--r----- 1 root root 703 Nov 17 21:08 /etc/sudoers
sudo cp "${jukebox_dir}"/misc/sampleconfigs/sudoers.buster-default.sample ${sudoers}
sudo cp "${jukebox_dir}"/misc/sampleconfigs/sudoers-default.sample ${sudoers}
sudo chown root:root "${sudoers}"
sudo chmod 440 "${sudoers}"
}
Expand Down Expand Up @@ -1023,7 +1023,7 @@ install_main() {
sudo systemctl disable phoniebox-rotary-encoder
sudo systemctl disable phoniebox-gpio-buttons.service
sudo rm "${systemd_dir}"/rfid-reader.service
sudo rm "${systemd_dir}"/startup-sound.service
sudo rm "${systemd_dir}"/phoniebox-startup-sound.service
sudo rm "${systemd_dir}"/gpio-buttons.service
sudo rm "${systemd_dir}"/idle-watchdog.service
sudo rm "${systemd_dir}"/phoniebox-rotary-encoder.service
Expand All @@ -1032,14 +1032,12 @@ install_main() {

# 2. install new ones - this is version > 1.1.8-beta
RFID_READER_SERVICE="${systemd_dir}/phoniebox-rfid-reader.service"
sudo cp "${jukebox_dir}"/misc/sampleconfigs/phoniebox-rfid-reader.service.stretch-default.sample "${RFID_READER_SERVICE}"
sudo cp "${jukebox_dir}"/misc/sampleconfigs/phoniebox-rfid-reader.service-default.sample "${RFID_READER_SERVICE}"
# Replace homedir; double quotes for variable expansion
sudo sed -i "s%/home/pi%${HOME_DIR}%g" "${RFID_READER_SERVICE}"

#startup sound now part of phoniebox-startup-scripts
#sudo cp "${jukebox_dir}"/misc/sampleconfigs/phoniebox-startup-sound.service.stretch-default.sample "${systemd_dir}"/phoniebox-startup-sound.service
STARTUP_SCRIPT_SERVICE="${systemd_dir}/phoniebox-startup-scripts.service"
sudo cp "${jukebox_dir}"/misc/sampleconfigs/phoniebox-startup-scripts.service.stretch-default.sample "${STARTUP_SCRIPT_SERVICE}"
sudo cp "${jukebox_dir}"/misc/sampleconfigs/phoniebox-startup-scripts.service-default.sample "${STARTUP_SCRIPT_SERVICE}"
# Replace homedir; double quotes for variable expansion
sudo sed -i "s%/home/pi%${HOME_DIR}%g" "${STARTUP_SCRIPT_SERVICE}"

Expand All @@ -1060,8 +1058,6 @@ install_main() {
# enable the services needed
sudo systemctl enable phoniebox-idle-watchdog
sudo systemctl enable phoniebox-rfid-reader
#startup sound is part of phoniebox-startup-scripts now
#sudo systemctl enable phoniebox-startup-sound
sudo systemctl enable phoniebox-startup-scripts
# copy mp3s for startup and shutdown sound to the right folder
cp "${jukebox_dir}"/misc/sampleconfigs/startupsound.mp3.sample "${jukebox_dir}"/shared/startupsound.mp3
Expand Down Expand Up @@ -1177,7 +1173,7 @@ wifi_settings() {
# DHCP configuration settings
local dhcpcd_conf="/etc/dhcpcd.conf"
#-rw-rw-r-- 1 root netdev 0 Apr 17 11:25 /etc/dhcpcd.conf
sudo cp "${jukebox_dir}"/misc/sampleconfigs/dhcpcd.conf.buster-default-noHotspot.sample "${dhcpcd_conf}"
sudo cp "${jukebox_dir}"/misc/sampleconfigs/dhcpcd.conf-default-noHotspot.sample "${dhcpcd_conf}"
# Change IP for router and Phoniebox
sudo sed -i 's/%WIFIinterface%/'"$WIFI_INTERFACE"'/' "${dhcpcd_conf}"
sudo sed -i 's/%WIFIip%/'"$WIFIip"'/' "${dhcpcd_conf}"
Expand Down

0 comments on commit 7bd8e9d

Please sign in to comment.