SIM800C/install.sh
2025-04-19 18:51:01 +02:00

26 lines
739 B
Bash

#!/bin/bash
# force run from root user
if [[ $EUID -ne 0 ]]; then
exec sudo "$0" "$@"
fi
set -e
apt update
apt install -y ppp curl
mkdir -p /etc/ppp/chatscripts
mkdir -p /etc/ppp/peers
mkdir -p /etc/init.d
mkdir -p /etc/systemd/system
curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/chat" > /etc/ppp/chatscripts/sim800c
curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/peer" > /etc/ppp/peers/sim800c
curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/script" > /etc/init.d/sim800c.sh
curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/service" > /etc/systemd/system/sim800c.service
chmod +x /etc/init.d/sim800c
systemctl enable sim800c
systemctl start sim800c