33 lines
699 B
Bash
Executable File
33 lines
699 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
echo Stopping daemons
|
|
snapctl stop --disable solana.daemon-drone
|
|
snapctl stop --disable solana.daemon-leader
|
|
snapctl stop --disable solana.daemon-validator
|
|
|
|
mode="$(snapctl get mode)"
|
|
if [[ -z "$mode" ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
num_tokens="$(snapctl get num-tokens)"
|
|
public_ip="$(snapctl get public-ip)"
|
|
$SNAP/bin/setup.sh ${num_tokens:+-n $num_tokens} ${public_ip:+-p $public_ip}
|
|
|
|
case $mode in
|
|
leader+drone)
|
|
snapctl start --enable solana.daemon-leader
|
|
snapctl start --enable solana.daemon-drone
|
|
;;
|
|
leader)
|
|
snapctl start --enable solana.daemon-leader
|
|
;;
|
|
validator)
|
|
snapctl start --enable solana.daemon-validator
|
|
;;
|
|
*)
|
|
echo "Error: Unknown mode: $mode"
|
|
exit 1
|
|
;;
|
|
esac
|