This repository has been archived by the owner on Oct 30, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 97
Moved user input to the top of the scripts. #109
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,13 @@ function appdaemon-install-package { | |
appdaemon-show-short-info | ||
appdaemon-show-copyright-info | ||
|
||
if [ "$ACCEPT" != "true" ]; then | ||
if [ -f "/usr/sbin/samba" ]; then | ||
echo -n "Do you want to add Samba share for AppDaemon configuration? [N/y] : " | ||
read SAMBA | ||
fi | ||
fi | ||
|
||
echo "Creating directory for AppDaemon Venv" | ||
sudo mkdir /srv/appdaemon | ||
sudo chown -R homeassistant:homeassistant /srv/appdaemon | ||
|
@@ -53,34 +60,37 @@ sync | |
|
||
echo "Starting AppDaemon service" | ||
systemctl start [email protected] | ||
if [ "$ACCEPT" != "true" ]; then | ||
if [ -f "/usr/sbin/samba" ]; then | ||
read -p "Do you want to add samba share for AppDaemon configuration? [N/y] : " SAMBA | ||
if [ "$SAMBA" == "y" ] || [ "$SAMBA" == "Y" ]; then | ||
echo "Adding configuration to samba..." | ||
echo "[appdaemon]" | tee -a /etc/samba/smb.conf | ||
echo "path = /home/homeassistant/appdaemon" | tee -a /etc/samba/smb.conf | ||
echo "writeable = yes" | tee -a /etc/samba/smb.conf | ||
echo "guest ok = yes" | tee -a /etc/samba/smb.conf | ||
echo "create mask = 0644" | tee -a /etc/samba/smb.conf | ||
echo "directory mask = 0755" | tee -a /etc/samba/smb.conf | ||
echo "force user = homeassistant" | tee -a /etc/samba/smb.conf | ||
echo "" | tee -a /etc/samba/smb.conf | ||
echo "Restarting Samba service" | ||
sudo systemctl restart smbd.service | ||
fi | ||
fi | ||
|
||
if [ "$SAMBA" == "y" ] || [ "$SAMBA" == "Y" ]; then | ||
echo "Adding configuration to Samba..." | ||
echo "[appdaemon]" | tee -a /etc/samba/smb.conf | ||
echo "path = /home/homeassistant/appdaemon" | tee -a /etc/samba/smb.conf | ||
echo "writeable = yes" | tee -a /etc/samba/smb.conf | ||
echo "guest ok = yes" | tee -a /etc/samba/smb.conf | ||
echo "create mask = 0644" | tee -a /etc/samba/smb.conf | ||
echo "directory mask = 0755" | tee -a /etc/samba/smb.conf | ||
echo "force user = homeassistant" | tee -a /etc/samba/smb.conf | ||
echo "" | tee -a /etc/samba/smb.conf | ||
echo "Restarting Samba service" | ||
sudo systemctl restart smbd.service | ||
fi | ||
|
||
echo | ||
echo "Installation done." | ||
echo | ||
echo "You may find the appdaemon configuration files in:" | ||
echo "/home/homeassistant/appdaemon" | ||
echo "To continue have a look at http://appdaemon.readthedocs.io/en/latest/" | ||
echo | ||
echo "If you have issues with this script, please say something in the #devs_hassbian channel on Discord." | ||
echo | ||
validation=$(ps -ef | grep -v grep | grep appdaemon | wc -l) | ||
if [ "$validation" != "0" ]; then | ||
echo | ||
echo -e "\e[32mInstallation done..\e[0m" | ||
echo | ||
echo "You will find the AppDaemon configuration files in:" | ||
echo "/home/homeassistant/appdaemon" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing white space. |
||
echo | ||
echo "To continue have a look at http://appdaemon.readthedocs.io/en/latest/" | ||
echo | ||
else | ||
echo -e "\e[31mInstallation failed..." | ||
echo -e "\e[31mAborting..." | ||
echo -e "\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord." | ||
return 1 | ||
fi | ||
return 0 | ||
} | ||
|
||
|
@@ -117,10 +127,8 @@ if [ "$validation" != "0" ]; then | |
echo | ||
echo "To continue have a look at http://appdaemon.readthedocs.io/en/latest/" | ||
echo | ||
echo "If you have issues with this script, please say something in the #devs_hassbian channel on Discord." | ||
echo | ||
else | ||
echo -e "\e[31mInstallation failed..." | ||
echo -e "\e[31mUpgrade failed..." | ||
echo -e "\e[31mAborting..." | ||
echo -e "\e[0mIf you have issues with this script, please say something in the #devs_hassbian channel on Discord." | ||
return 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing white space.