These scripts are designed to provide a user-friendly command-line interface for controlling Ollama servers. This repository contains two scripts for controlling Ollama servers: one written in Bash (ollama_control_forbash
) and the other written in sh (ollama_control_forsh
). These scripts provide common tasks such as starting, stopping, updating, and launching specific models with Ollama servers, thus simplifying system management.
-
Start Ollama Server: This option starts the Ollama service if it is not already running. The script first checks if the service is already active before attempting to start it.
-
Stop Ollama Server: Stopping the Ollama service is done by first checking if the service is currently running. If it is, the script stops the service; otherwise, it reports that the service is already stopped.
-
Update and Install Ollama: This feature updates and installs the latest version of Ollama by downloading the official installation script from
https://ollama.ai/install.sh
and executing it viash
. However, this operation can only be performed when the Ollama service is stopped to avoid disruption during the update. -
List Installed Models: When the Ollama service is active, the script displays a list of models currently installed on the server. It uses the
ollama list
command to obtain this information. -
Launch Specific Models: This feature allows the user to select an installed model and launch it with the Ollama server. The script retrieves the list of installed models, then prompts the user to choose a specific model. Once selected, the model is launched with the
ollama run
command. -
Check Ollama Server Status: The script can check whether the Ollama service is currently active or stopped using the
systemctl is-active
command.
- Operating System: The script is designed to work on Linux systems.
- Ollama Installed: Make sure you have installed and configured the Ollama server on your system before using this script. Visit https://ollama.com/ for more information.
-
Clone the Repository:
git clone https://github.com/Superjulien/Ollama_control.git
-
Navigate to the Project Directory:
cd Ollama_control
-
Give Execution Rights to the Script:
chmod +x ollama_control_forsh.sh
or
chmod +x ollama_control_forbash.sh
-
Run the Script:
sudo sh ollama_control_forsh.sh
or
sudo bash ollama_control_forbash.sh
-
Follow the on-screen instructions to choose from the available options.
-
Main Loop: The script uses a
while true
loop to display the menu and wait for user input until they choose to quit. -
Option Handling: The script uses a
case
structure to handle the different options selected by the user. -
Service Status Check: Before performing certain actions, such as starting or stopping the Ollama service, the script first checks whether the service is already active or stopped.
-
Interaction with Ollama: For operations such as listing installed models and launching specific models, the script uses appropriate Ollama commands, such as
ollama list
andollama run
.
This software is provided to you free of charge, with the hope that if you find it valuable, you'll consider making a donation to a charitable organization of your choice :
-
SPA (Society for the Protection of Animals): The SPA is one of the oldest and most recognized organizations in France for the protection of domestic animals. It provides shelters, veterinary care, and works towards responsible adoption.
-
French Popular Aid: This organization aims to fight against poverty and exclusion by providing food aid, clothing, and organizing recreational activities for disadvantaged individuals.
-
Doctors Without Borders (MSF): MSF provides emergency medical assistance to populations in danger around the world, particularly in conflict zones and humanitarian crises.
-
Restaurants of the Heart : Restaurants of the Heart provides meals, emergency accommodation, and social services to the underprivileged.
-
French Red Cross: The Red Cross offers humanitarian aid, emergency relief, first aid training, as well as social and medical activities for vulnerable individuals.
Every small gesture matters and contributes to making a real difference.
Ollama Control is open-source software released under the MIT License. This license allows users of this software to use it, modify it, distribute it, and share it freely while preserving transparency and collaboration.
For support email :