-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
55 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@echo off | ||
REM Start the sshd service | ||
powershell -Command "Start-Service sshd" | ||
|
||
REM Check if the sshd service is running | ||
powershell -Command "Get-Service sshd | Select-Object Status" | ||
|
||
REM Save the service status to a variable for logging | ||
for /f "tokens=2 delims= " %%a in ('powershell -Command "Get-Service sshd | Select-Object -ExpandProperty Status"') do set status=%%a | ||
|
||
REM Log the service status to a file | ||
echo The sshd service is in status: %status% >> sshd_service_log.txt | ||
|
||
REM Display the status on the screen | ||
echo The sshd service is in status: %status% | ||
|
||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
# Start the sshd service | ||
sudo systemctl start sshd | ||
|
||
# Check if the sshd service is running | ||
service_status=$(systemctl is-active sshd) | ||
|
||
# Log the service status to a file | ||
echo "The sshd service is in status: $service_status" >> sshd_service_log.txt | ||
|
||
# Display the status on the screen | ||
echo "The sshd service is in status: $service_status" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters