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

Update scripts from dev branch #50

Merged
merged 2 commits into from
Sep 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions package/opt/hassbian/suites/upgrade_hassbian-script-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
function hassbian-script-dev-show-short-info {
echo "Uppdates scripts from the dev branch."
}

function hassbian-script-dev-show-long-info {
echo "This scripts downloads new scripts directly from the dev branch on github."
echo "you can use this to be on the 'bleeding edge of the development of Hassbian.'"
echo "This is not recomended for daily use."
}

function hassbian-script-dev-show-copyright-info {
echo "Original concept by Ludeeus <https://github.com/Ludeeus>"
}

function hassbian-script-dev-upgrade-package {
hassbian-script-dev-show-short-info
hassbian-script-dev-show-copyright-info

echo "Creation and changing in to temporary folder."
cd
sudo mkdir /tmp/hassbian_config_update
cd /tmp/hassbian_config_update

echo "Downloading new scripts from github."
curl -L https://api.github.com/repos/home-assistant/hassbian-scripts/tarball| sudo tar xz --strip=1

echo "Moving scripts to the correct folder."
yes | sudo cp -rf /tmp/hassbian_config_update/package/usr/local/bin/hassbian-config /usr/local/bin/hassbian-config
yes | sudo cp -rf /tmp/hassbian_config_update/package/opt/hassbian/suites/* /opt/hassbian/suites/

echo "Removing the temporary folder."
cd
sudo rm -r /tmp/hassbian_config_update

echo
echo "Upgrade is done."
echo
echo "If you have issues with this script, please say something in the #Hassbian channel on Discord."
echo
return 0
}

# Make this script function as it always has if run standalone, rather than issue a warning and do nothing.
[[ $0 == "$BASH_SOURCE" ]] && hassbian-script-dev-upgrade-package