#!/bin/bash

while true
do	
	TIME=`date --utc '+%H%M'`

	if [ "$TIME" = '2000' ] || [ "$TIME" = '0000' ]; then # reboot at 10pm and 12am GMT+2
		cp /root/.docker/config.json /home/slite/.ssh/config.json
		chmod 600 ~/.ssh/id_rsa
		pkill -f code-server
	fi

	sleep 50
done
