raspiblitz/home.admin/_commands.sh

92 lines
2 KiB
Bash
Raw Normal View History

2018-12-24 00:56:22 +01:00
#!/bin/bash
# SHORTCUT COMMANDS you can call as user 'admin' from terminal
2020-04-29 14:16:47 +02:00
# command: raspiblitz
2019-06-30 19:55:18 +02:00
# calls the the raspiblitz mainmenu (legacy)
2020-04-29 14:16:47 +02:00
function raspiblitz() {
2019-06-30 19:55:18 +02:00
cd /home/admin
./00raspiblitz.sh
}
# command: blitz
# calls the the raspiblitz mainmenu (shortcut)
function blitz() {
cd /home/admin
2019-04-16 18:55:25 +01:00
./00raspiblitz.sh
2019-06-30 17:47:11 +02:00
}
# command: menu
# calls directly the main menu
function menu() {
cd /home/admin
./00mainMenu.sh
}
# command: repair
# calls directly the repair menu
2019-06-30 19:55:18 +02:00
function repair() {
2019-06-30 17:47:11 +02:00
cd /home/admin
./98repairMenu.sh
2019-12-19 00:23:54 +01:00
}
2020-02-20 13:24:57 +01:00
# command: check
function check() {
/home/admin/config.scripts/blitz.configcheck.py
}
2020-04-28 18:28:49 +02:00
# command: debug
function debug() {
cd /home/admin
./XXdebugLogs.sh
}
# command: restart
function restart() {
cd /home/admin
./XXshutdown.sh reboot
}
# command: restart
function off() {
cd /home/admin
./XXshutdown.sh
}
2020-01-24 21:46:51 +01:00
# command: hdmi
function hdmi() {
echo "# SWITCHING VIDEO OUTPUT TO --> HDMI"
2020-01-24 21:55:54 +01:00
sudo /home/admin/config.scripts/blitz.lcd.sh hdmi on
2020-01-24 21:46:51 +01:00
}
# command: lcd
function lcd() {
echo "# SWITCHING VIDEO OUTPUT TO --> LCD"
2020-01-24 21:55:54 +01:00
sudo /home/admin/config.scripts/blitz.lcd.sh hdmi off
2020-01-24 21:46:51 +01:00
}
2019-12-19 00:29:53 +01:00
# command: manage
function manage() {
2019-12-19 00:23:54 +01:00
if [ $(cat /mnt/hdd/raspiblitz.conf 2>/dev/null | grep -c "lndmanage=on") -eq 1 ]; then
2019-12-19 00:29:53 +01:00
cd /home/admin/lndmanage
2019-12-19 00:23:54 +01:00
source venv/bin/activate
echo "NOTICE: Needs at least one active channel to run without error."
2019-12-19 00:29:53 +01:00
echo "to exit (venv) enter ---> deactivate"
2019-12-19 00:23:54 +01:00
lndmanage
else
2020-01-23 17:48:11 +01:00
echo "lndmanage not installed - to install run:"
2019-12-19 00:23:54 +01:00
echo "sudo /home/admin/config.scripts/bonus.lndmanage.sh on"
fi
}
2020-04-29 14:16:47 +02:00
# command: torthistx
function torthistx() {
if [ $(cat /mnt/hdd/raspiblitz.conf 2>/dev/null | grep -c "runBehindTor=on") -eq 1 ]; then
echo "Broadcasting transaction through Tor to Blockstreams API and into the network."
curl --socks5-hostname localhost:9050 -d $1 -X POST http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/api/tx
else
echo "Not running behind Tor - to install run:"
echo "sudo /home/admin/config.scripts/internet.tor.sh on"
fi
}