From 4e1c06a63ef5582eff84f54da3d96b7c9029f321 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 5 Aug 2026 07:50:08 -0400 Subject: [PATCH] add placeholder entertaiment --- bin/pos-entertaiment | 7 +++++++ entertainment/gold.sh | 26 ++++++++++++++++++++++++++ entertainment/{weather => }/weather.sh | 0 preinstall.sh | 2 +- systemd/pos-entertainment.service | 8 ++++++++ systemd/pos-entertainment.timer | 10 ++++++++++ 6 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 bin/pos-entertaiment create mode 100755 entertainment/gold.sh rename entertainment/{weather => }/weather.sh (100%) mode change 100644 => 100755 create mode 100644 systemd/pos-entertainment.service create mode 100644 systemd/pos-entertainment.timer diff --git a/bin/pos-entertaiment b/bin/pos-entertaiment new file mode 100644 index 0000000..9282ed6 --- /dev/null +++ b/bin/pos-entertaiment @@ -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" + diff --git a/entertainment/gold.sh b/entertainment/gold.sh new file mode 100755 index 0000000..9221f06 --- /dev/null +++ b/entertainment/gold.sh @@ -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" \ No newline at end of file diff --git a/entertainment/weather/weather.sh b/entertainment/weather.sh old mode 100644 new mode 100755 similarity index 100% rename from entertainment/weather/weather.sh rename to entertainment/weather.sh diff --git a/preinstall.sh b/preinstall.sh index 127d3f2..b534634 100755 --- a/preinstall.sh +++ b/preinstall.sh @@ -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 diff --git a/systemd/pos-entertainment.service b/systemd/pos-entertainment.service new file mode 100644 index 0000000..833d6fd --- /dev/null +++ b/systemd/pos-entertainment.service @@ -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 \ No newline at end of file diff --git a/systemd/pos-entertainment.timer b/systemd/pos-entertainment.timer new file mode 100644 index 0000000..9436b7d --- /dev/null +++ b/systemd/pos-entertainment.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Run POS Entertainment Hourly + +[Timer] +OnBootSec=5min +OnUnitActiveSec=1h +Persistent=true + +[Install] +WantedBy=timers.target \ No newline at end of file