Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Feb 16, 2018
1 parent 0364904 commit f1de5b4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
4 changes: 2 additions & 2 deletions package/opt/hassbian/suites/appdaemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if [ "$SAMBA" == "y" ] || [ "$SAMBA" == "Y" ]; then
fi

validation=$(pgrep -f appdaemon)
if [ "$validation" == NULL ]; then
if [ "$validation" != NULL ]; then
echo
echo -e "\e[32mInstallation done..\e[0m"
echo
Expand Down Expand Up @@ -121,7 +121,7 @@ systemctl start [email protected]

echo "Checking the installation..."
validation=$(pgrep -f appdaemon)
if [ "$validation" == NULL ]; then
if [ "$validation" != NULL ]; then
echo
echo -e "\e[32mUppgrade done..\e[0m"
echo
Expand Down
2 changes: 1 addition & 1 deletion package/opt/hassbian/suites/homebridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ fi

echo "Checking the installation..."
validation=$(pgrep -f homebridge)
if [ "$validation" == NULL ]; then
if [ "$validation" != NULL ]; then
echo
echo -e "\e[32mInstallation done.\e[0m"
echo
Expand Down
2 changes: 1 addition & 1 deletion package/opt/hassbian/suites/mosquitto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ ip_address=$(ifconfig | grep "inet.*broadcast" | grep -v 0.0.0.0 | awk '{print $

echo "Checking the installation..."
validation=$(pgrep -f mosquitto)
if [ "$validation" == NULL ]; then
if [ "$validation" != NULL ]; then
echo
echo -e "\e[32mInstallation done.\e[0m"
echo
Expand Down
36 changes: 14 additions & 22 deletions package/usr/local/bin/hassbian-config
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ function check-permission {
function share-log {
if [ "$ACCEPT" == "true" ]; then
a=$(cat $LOGFILE); curl -X POST -s -d "$a" https://hastebin.com/documents | awk -F '"' '{print "https://hastebin.com/"$4}'
else
echo "This will put the output from your last operation on hastebin."
echo "This could include sensitive informastion."
echo "If you are unsure about what it contains, you can rin 'hassbian-config log' to check."
read -p -r "Do you want to crate an hastebin link? [N/y] : " RESPONSE
else
echo "This will put the output from your last operation on hastebin."
echo "This could include sensitive informastion."
echo "If you are unsure about what it contains, you can rin 'hassbian-config log' to check."
echo -n "Do you want to crate an hastebin link? [N/y] : "
read -r RESPONSE
if [ "$RESPONSE" == "y" ] || [ "$RESPONSE" == "Y" ]; then
echo ""
a=$(cat $LOGFILE); curl -X POST -s -d "$a" https://hastebin.com/documents | awk -F '"' '{print "https://hastebin.com/"$4}'
Expand Down Expand Up @@ -124,8 +125,7 @@ function upgrade-suite {
}

function verify-suite {
if [ -f "$SUITE_INSTALL_DIR/$1.sh" ]
then
if [ -f "$SUITE_INSTALL_DIR/$1.sh" ]; then
retval=0 # beware - 0 is true in bash.
else
retval=1
Expand All @@ -134,21 +134,22 @@ function verify-suite {
}

function show-installed-suites {
INSTALLERS=$(find $SUITE_CONTROL_DIR/ -maxdepth 1 -type f | awk -F'/|_' ' {print $NF}' | grep -v 'homeassistant' | awk -F. '{print $1}')
INSTALLERS=$(find $SUITE_INSTALL_DIR/ -maxdepth 1 -type f | sort | awk -F'/' ' {print $NF}' | awk -F. '{print $1}')
for i in $INSTALLERS
do
if [ -f "$SUITE_CONTROL_DIR/$i" ]; then
STATE=$(grep "SCRIPTSTATE=installed" $SUITE_CONTROL_DIR/"$i" | awk -F'=' '{print $2}')
if [ "$STATE" != "" ]; then
echo "$i:" "$STATE"
if [ "$STATE" != "" ]; then
echo "$i:" "$STATE"
fi
fi
done
return 0
}

if [ $# -lt 1 ]
then
if [ $# -lt 1 ]; then
usage
return 0
exit 0
fi

while [[ $# -gt 0 ]]
Expand Down Expand Up @@ -188,15 +189,6 @@ case $COMMAND in
shift # past argument
shift # past value
;;
"info")
if verify-suite "$SUITE"; then
RUN="info-suite $SUITE"
else
RUN="echo suite $SUITE doesn't exist."
fi
shift # past argument
shift # past value
;;
"upgrade")
if verify-suite "$SUITE"; then
RUN="upgrade-suite $SUITE"
Expand Down

0 comments on commit f1de5b4

Please sign in to comment.