add placeholder entertaiment
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
#This pos-entertaiment bin for configure enable or disable entertaiments elements such enable/disable weather, gold ...so on
|
||||
# and check flags to choose wich entertaiments to run or not
|
||||
set -euo pipefail
|
||||
|
||||
CONFIG_DIR="$HOME/.config/linux_post_install"
|
||||
CONFIG_FILE="$CONFIG_DIR/entertaiment.env"
|
||||
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
DATA=$(curl -s "https://api.coingecko.com/api/v3/simple/price?ids=pax-gold&vs_currencies=usd")
|
||||
|
||||
if [ -z "$DATA" ]; then
|
||||
echo "Gold API unavailable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PRICE=$(echo "$DATA" | grep -o '"usd":[0-9.]*' | cut -d: -f2)
|
||||
|
||||
if [ -z "$PRICE" ]; then
|
||||
echo "Parse error"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
GRAM=$(echo "scale=2; $PRICE / 31.1035" | bc)
|
||||
|
||||
MESSAGE="🪙 Gold Price
|
||||
|
||||
1 oz: $PRICE USD
|
||||
1 gram: $GRAM USD"
|
||||
|
||||
echo "$MESSAGE"
|
||||
|
||||
pos communication telegram --send "$MESSAGE"
|
||||
Regular → Executable
+1
-1
@@ -26,7 +26,7 @@ while [[ $# -gt 0 ]]; do
|
||||
done
|
||||
|
||||
PACKAGES=(
|
||||
git curl wget vim nano tmux tree jq
|
||||
git curl wget bc vim nano tmux tree jq
|
||||
unzip zip rsync htop btop telnet
|
||||
net-tools iputils-ping traceroute tcpdump nmap
|
||||
openssh-client openssh-server ufw fail2ban
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=POS Entertainment Runner
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/bin/pos-entertainment --run
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Run POS Entertainment Hourly
|
||||
|
||||
[Timer]
|
||||
OnBootSec=5min
|
||||
OnUnitActiveSec=1h
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in New Issue
Block a user