#!/bin/bash source /home/joinmarket/joinin.conf source /home/joinmarket/_functions.sh script="$1" wallet="$2" echo echo "# Making sure $script not running" sudo systemctl stop $script sudo systemctl disable $script if [ $script == "yg-privacyenhanced" ]; then # shut down the process gracefully pkill -sigint -f "python yg-privacyenhanced.py $wallet --wallet-password-stdin" # make sure the lock file is deleted rm -f ~/.joinmarket/wallets/.$wallet.lock # for old version /dev/null echo echo "# Starting the systemd service: $script" echo sudo systemctl enable $script sudo systemctl start $script echo echo "# Shredding the password once used..." echo sleep 5 # delete password once used shred -uvz /dev/shm/.pw