This repository contains scripts to conveniently start and stop the Owncast server on macOS and Linux platforms.
script is used to manage an Owncast server, ensuring that it is properly configured with the correct IP address and network interface, and that it is not already running before starting it. It also provides options to stop a running Owncast server and to change the IP address in a remote VPS configuration.
-
It starts by defining some ANSI color codes for console output.
-
It then determines the directory of the script and loads a configuration file (
config.sh
) from the same directory. -
The script checks if an Owncast server is already running. If it is, it asks the user if they want to stop the server. If the user chooses to stop the server, it kills the Owncast process and exits. If the user chooses not to stop the server, the script simply terminates.
-
If the Owncast server is not running, the script proceeds to get information about the network connection. It asks the user to choose between Wi-Fi and Ethernet, and sets the
interface_id
variable accordingly. -
The script then checks if the chosen network interface exists. If it doesn't, it prints an error message and exits.
-
The script then retrieves the local IP address of the chosen network interface.
-
The script defines a function
launch_owncast
which does the following:-
It checks if the local IP address matches the IP address in the configuration of a remote VPS (Virtual Private Server). If they match, it starts the Owncast server in the background, opens OBS (Open Broadcaster Software), and optionally starts a Trakt Discord Presence Python script. It then exits.
-
If the local IP address does not match the IP address in the VPS configuration, it asks the user if they want to proceed. If the user chooses to proceed, it changes the IP address in the VPS configuration to the local IP address, and then reruns the
launch_owncast
function. If the user chooses not to proceed, it prints an error message and exits.
-
-
Finally, the script calls the
launch_owncast
function to start the Owncast server.
- Owncast server installed on your machine. You can find more information on how to install Owncast here.
- A pre-configured Cloudflare Tunnel is required for optimal functionality. Installation instructions can be found here.
- If you want to have shortcuts on your desktop with a nice icon, here and here are the icons that I use.
-
Clone this repository to your local machine.
git clone https://github.com/the-maty/owncast-server-scripts.git
-
Create your config.sh file from example-config.sh .
To start the Owncast server including Cloudflare Tunnel, use the following command:
chmod 600 config.sh
chmod +x owncast-script.sh
./owncast-script.sh
To gracefully stop the Owncast server, execute the following command:
chmod +x owncast-stop.sh
./owncast-stop.sh
These scripts are designed to work seamlessly on both macOS and Linux platforms.
- macOS: Tested on macOS version 10.15 and later.
- Linux: Successfully tested on Ubuntu 18.04 and later.
Feel free to use these scripts on your preferred operating system, ensuring a consistent experience across compatible environments.
## Contributing