make token.nim to target machine's home directory
- Install some package that needs to use this.
sudo apt install snap git cron -y
sudo snap install nim-lang --classic
- Write this code to ShellScript file "setup.sh".
#! /bin/sh -e
git clone https://github.com/penta2himajin/bitCat
cp token.nim bitCat/src/token.nim
cd bitCat
nimble build_project
cd ..
cp bitCat/bin/bitCat bitCat_exec
sudo rm -rf bitCat
mv bitCat_exec bitCat
crontab -l > temp
echo "* * * * * `pwd`/bitCat" >> temp
crontab -u `whoami` temp
rm temp
rm setup.sh
- Granting authority to the file.
- Execute the file.