Subversion Repositories ALCASAR

Rev

Rev 3311 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3311 Rev 3313
Line 95... Line 95...
95
 
95
 
96
	echo "Resetting replication with '$name'..."
96
	echo "Resetting replication with '$name'..."
97
	exec_query "RESET REPLICA '$name' ALL" || return
97
	exec_query "RESET REPLICA '$name' ALL" || return
98
 
98
 
99
	echo "Deleting SSH tunnel with '$name'..."
99
	echo "Deleting SSH tunnel with '$name'..."
100
	service_file="/etc/systemd/system/replication-$name.service"
100
	service_file="replication-$name.service"
-
 
101
	service_path="/etc/systemd/system/$service_file"
101
	[ -f "$service_file" ] && systemctl stop "$service_file" && rm "$service_file"
102
	[ -f "$service_path" ] && systemctl stop "$service_file" && systemctl disable "$service_file"
-
 
103
	
-
 
104
	# Get remote IP and port from its name
-
 
105
	port="$(grep "ExecStart" "$service_path" | cut -d ' ' -f 9)"
-
 
106
	ip="$(grep "ExecStart" "$service_path" | cut -d ' ' -f 14 | cut -d '@' -f2)"
-
 
107
	echo "Disabling outbound connection to remote SSH ($ip:$port)"
-
 
108
	sed -i "/^REPLICATION_TO=/s/$ip:$port,//" /usr/local/etc/alcasar.conf
-
 
109
	/usr/local/bin/alcasar-iptables.sh
-
 
110
	rm "$service_path"
102
}
111
}
103
 
112
 
104
# Print help message
113
# Print help message
105
usage() {
114
usage() {
106
	echo "usage: $0 OPTIONS"
115
	echo "usage: $0 OPTIONS"