Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

begin moving functions to common.sh (top htop) #776

Merged
merged 48 commits into from
Dec 31, 2024

Conversation

tschettervictor
Copy link
Collaborator

@tschettervictor tschettervictor commented Dec 16, 2024

@bmac2

This was a simple first task. Do you think something like this will work?

this basically move the functions to check if a jail is running into common.sh and top and htop are the first files for it to be integrated.

Testing just requires runnin top and htop on a jail. Making sure to see if the command recognized a stopped and started jail. I also added a -f option to start it if it is stopped.

@tschettervictor tschettervictor changed the title begin moving functions to common.sh begin moving functions to common.sh (top htop) Dec 16, 2024
@yaazkal
Copy link
Collaborator

yaazkal commented Dec 17, 2024

why accepting ALL as a target for top and htop. How that will work?

@tschettervictor
Copy link
Collaborator Author

why accepting ALL as a target for top and htop. How that will work?

That was already in the top and htop file. It works but you have to press CTRL+C to jump to the next one...

@tschettervictor
Copy link
Collaborator Author

I've now changed it to where the set_target_single function will only set the target, and the check_target_exists will only verify that it exists. With this, it is probably necessary to first set, then check existence, the check if TARGET is running (only needed for some commands)

I've also modified it so htop and top now only accept one argument.

@tschettervictor
Copy link
Collaborator Author

tschettervictor commented Dec 20, 2024

I've reorganized the functions inside common.sh to alphabetical order and improved error handling.

@tschettervictor
Copy link
Collaborator Author

@yaazkal this PR is the first step in migrating some functions.

  1. It arranges the commons.sh functions in alphabetical order
  2. It moves the "top and "htop" commands to the list of commands that only get passed on inside "/usr/local/bin/bastille"
  3. It uses the new "set_target_single" function for both

Let me know if you have any questions.

@bmac2
Copy link
Collaborator

bmac2 commented Dec 31, 2024

tested successfully

@bmac2 bmac2 merged commit ac39d4a into BastilleBSD:master Dec 31, 2024
1 check passed
@tschettervictor tschettervictor deleted the check_jail_exists-function branch December 31, 2024 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants