#!/bin/ash [ $(whoami) != "root" ] && echo "Must run as root!" && exit 1 echo "Installing dependencies..." apk add lighttpd curl jq bash youtube-dl ffmpeg read -p "Please enter your bot token: " token read -p "Please enter the bot's username (without @): " bot read -p "Please enter the domain for your bot: " domain read -p "Do you want to use a log chat? (y/n): " logans [ ! -z $logans ] && read -p "What's the log chat's chat ID? " logchat if [ -f /etc/konata.conf ] then read -p "/etc/konata.conf already exists. Do you want to remove it? (y/n) " ans if [ "$ans" == "y" ] then rm /etc/konata.conf else echo "Keeping file. Please investigate this file and run the installer again." exit 1 fi else echo "token=$token" >> /etc/konata.conf echo "bot=$bot" >> /etc/konata.conf [ ! -z $logchat ] && echo "logchat=$logchat" >> /etc/konata.conf fi echo "Installing application files..." install -m644 lighttpd.conf /etc/lighttpd/lighttpd.conf mkdir /var/www/konata rand=$RANDOM install -m755 konata.sh /usr/local/bin/konata ln -s /usr/local/bin/konata /var/www/konata/$rand.sh echo "Requesting Telegram to use our webhook..." curl -X POST "https://api.telegram.org/bot$token/setWebhook" \ -d "url=$domain/$rand.sh" echo "" echo "The webhook has been set to $domain/$rand.sh." echo "That should be everything! Enjoy your new bot!"