Last active
January 1, 2022 06:12
-
-
Save eyedeekay/6bfa5b7c9bd0082d870d262eb3c32be2 to your computer and use it in GitHub Desktop.
ShellService Docker Wrapper Script
This file contains hidden or 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
#! /usr/bin/env sh | |
# this script acts as a sort of proxy to a ShellService for starting | |
# and stopping a docker container from the I2P UI. The loop will keep | |
# going as long as docker ps returns true, retaining the same PID. | |
# Check every 5 seconds | |
shellservice_wd=$(pwd) | |
shellservice_name=$(basename "$shellservice_wd") | |
shellservice_therest="$@" | |
docker run -itd --name $shellservice_name $shellservice_therest | |
while true; do | |
sleep 5s | |
docker ps "$shellservice_name" || \ | |
break | |
done | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment