Add extension to script filename

This commit is contained in:
Foster Hangdaan 2023-12-04 08:36:58 -05:00
parent a18101eaba
commit 76630a7ff9
Signed by: foster
GPG key ID: E48D7F49A852F112

View file

@ -123,7 +123,7 @@ ## The Script
Here is the content of the script: Here is the content of the script:
``` ts ``` ts
#!/usr/bin/env -S deno run --ext=ts --allow-net #!/usr/bin/env -S deno run --allow-net
/** /**
* Copyright (c) 2023 Foster Hangdaan <https://www.fosterhangdaan.com> * Copyright (c) 2023 Foster Hangdaan <https://www.fosterhangdaan.com>
@ -194,7 +194,7 @@ ## The Script
## Schedule the Script to Run Every Hour with Cron ## Schedule the Script to Run Every Hour with Cron
On the Host Computer, save [the script](#the-script) as a file at `/etc/cron.hourly/ddns`. Make sure to replace some necessary values: On the Host Computer, save [the script](#the-script) as a file at `/etc/cron.hourly/ddns.ts`. Make sure to replace some necessary values:
- Replace `example.com` in `const domain = "example.com";` with your domain. - Replace `example.com` in `const domain = "example.com";` with your domain.
- Replace `key` in `const GODADDY_API_KEY = "key";` with your GoDaddy API key. - Replace `key` in `const GODADDY_API_KEY = "key";` with your GoDaddy API key.
@ -203,8 +203,8 @@ ## Schedule the Script to Run Every Hour with Cron
Grant read, write, and execute permissions only to the `root` user: Grant read, write, and execute permissions only to the `root` user:
``` sh ``` sh
sudo chown root:root /etc/cron.hourly/ddns sudo chown root:root /etc/cron.hourly/ddns.ts
sudo chmod 700 /etc/cron.hourly/ddns sudo chmod 700 /etc/cron.hourly/ddns.ts
``` ```
> Access to the script should be granted only to authorized users (such as `root`) since the script contains sensitive information: your GoDaddy API secret and key. > Access to the script should be granted only to authorized users (such as `root`) since the script contains sensitive information: your GoDaddy API secret and key.