Video
About
Occasionally, the CasaOS container settings UI may not grant us the flexibility to modify configurations as we desire. To address this challenge, we’ve developed a script that simplifies the process:
bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/edit-casaos-apps/run.sh)"
This script allows you to choose your desired application and select your preferred text editor, currently supporting Nano and Vim.
How does it work
- It’s a Bash script designed for execution in your terminal.
- The script is fetched and executed in a single command using
wget
andbash
. - Here’s a breakdown of the command:
bash -c
: This instructs your shell to execute the subsequent command.wget -qLO -
: This part of the command employswget
to download a script from the specified URL.-q
: Quiet mode, reducingwget
’s output.-O -
: This option tellswget
to write the downloaded content to the standard output (the terminal) instead of saving it to a file.
https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/edit-casaos-apps/run.sh
: The URL points to the script you want to download and execute.
- Once the script is fetched and executed, it provides a menu that allows you to choose a specific CasaOS application for configuration.
- After selecting the application, the script prompts you to pick a text editor from the available options, which are currently nano and vim.
- Once you’ve made your selections, the script opens the configuration file for the chosen CasaOS application using the selected text editor, enabling you to make the desired changes.
- After you’ve made the necessary changes and saved them in the text editor, the script reloads the CasaOS application in the background, to apply the configuration changes you made.
Edit and Save changes
For Vim:
- Insert/Edit Text: Press
i
to enter insert mode. You can now edit or insert text as needed. - Save Changes:
- Press
Esc
to exit insert mode. - To save changes, type
:w
and pressEnter
. This command writes (saves) the changes to the file.
- Exit Vim:
- To exit Vim after saving, type
:q
and pressEnter
. This command quits Vim. - If you’ve made changes and haven’t saved, you can use
:q!
to forcefully exit without saving. - To save and exit in one command, you can use
:wq
and pressEnter
.
For Nano:
- Insert/Edit Text: You can start editing the text immediately in Nano.
- Save Changes:
- To save changes, press
Ctrl
+O
(holdCtrl
and pressO
). Nano will prompt you to confirm the file name; pressEnter
to save. - You can keep the same file name or change it if needed.
- Exit Nano:
- To exit Nano, press
Ctrl
+X
(holdCtrl
and pressX
). If you’ve made changes, Nano will prompt you to save them; pressY
to confirm andEnter
to save.