18 lines
477 B
TypeScript
18 lines
477 B
TypeScript
import type { BUN_SQLITE_WGUI_VARIABLES } from "@/db/types/db";
|
|
|
|
type Params = {
|
|
variables?: BUN_SQLITE_WGUI_VARIABLES[];
|
|
};
|
|
|
|
export default function checkIfMainHostIsSet({ variables }: Params) {
|
|
const is_main_host_set =
|
|
Boolean(
|
|
variables?.find((v) => v.key == "main_host_wg_ip_address")?.value,
|
|
) &&
|
|
Boolean(
|
|
variables?.find((v) => v.key == "main_host_wg_public_key")?.value,
|
|
);
|
|
|
|
return is_main_host_set;
|
|
}
|