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

Added installation script for an web terminal. #46

Merged
merged 2 commits into from
Sep 21, 2017
Merged
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,19 @@ sudo hassbian-config install tradfri
```
This script was originally contributed by [@Landrash](https://github.com/Landrash).

### Install an web terminal for easy access to ssh in an web browser *(install_webterminal.sh)*
This script installs an web terminal called 'shellinabox' to you system that give you SHH access in you web browser.

Script is run as the `pi` user with the following command:
```
sudo hassbian-config install webterminal
```
Example config for Home-Assistant:
```yaml
panel_iframe:
terminal:
title: 'Terminal'
icon: mdi:console
url: 'http://192.168.1.2:4200'
```
This script was originally contributed by [@Ludeeus](https://github.com/Ludeeus).
39 changes: 39 additions & 0 deletions package/opt/hassbian/suites/install_webterminal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
function webterminal-show-short-info {
echo "Installs an websevice terminal."
}

function webterminal-show-long-info {
echo "Installs an websevice terminal to controll your installation."
}

function webterminal-show-copyright-info {
echo "Original consept by Ludeeus <https://github.com/ludeeus>"
}

function webterminal-install-package {
echo "Installing packages."
sudo apt-get install -y openssl shellinabox

echo "Changing config."
sudo sed -i 's/--no-beep/--no-beep --disable-ssl/g' /etc/default/shellinabox

echo "Reloading and starting the service."
sudo service shellinabox reload
sudo service shellinabox restart

ip_address=$(ifconfig | grep "inet.*broadcast" | grep -v 0.0.0.0 | awk '{print $2}')

echo
echo "Installation done."
echo
echo "You can now access the web terminal here: http://$ip_address:4200"
echo "You can also add this to your Home-Assistant config in an 'panel_iframe'"
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" ]] && webterminal-install-package