take out littleboss remnants, rewrite initscript to use start-stop-daemon

This commit is contained in:
idk
2021-12-01 16:28:52 -05:00
parent 2a286e1383
commit 2f067908ba
2 changed files with 9 additions and 30 deletions

View File

@@ -12,7 +12,6 @@ import (
"strconv"
"time"
//"crawshaw.io/littleboss"
"github.com/cretz/bine/tor"
"github.com/cretz/bine/torutil"
"github.com/cretz/bine/torutil/ed25519"
@@ -128,11 +127,6 @@ func NewReseedCommand() cli.Command {
Value: "127.0.0.1:7656",
Usage: "Use this SAM address to set up I2P connections for in-network reseed",
},
cli.StringFlag{
Name: "littleboss",
Value: "start",
Usage: "Self-Supervise this application",
},
cli.BoolFlag{
Name: "acme",
Usage: "Automatically generate a TLS certificate with the ACME protocol, defaults to Let's Encrypt",
@@ -192,11 +186,6 @@ func LoadKeys(keysPath string, c *cli.Context) (i2pkeys.I2PKeys, error) {
}
func reseedAction(c *cli.Context) {
// validate flags
if c.String("littleboss") != "start" {
log.Println("--littleboss", c.String("littleboss"))
return
}
netdbDir := c.String("netdb")
if netdbDir == "" {
fmt.Println("--netdb is required")

View File

@@ -15,35 +15,25 @@ RUNDIR=/var/lib/i2p/i2p-config/reseed
SIGNER=you@mail.i2p
MORE_OPTIONS=""
if [ -f /etc/default/reseed ]; then
source /etc/default/reseed
. /etc/default/reseed
fi
RUNOPTS=" reseed --signer=$SIGNER --netdb=$NETDBDIR $MORE_OPTIONS "
rundir(){
if [ !-d $RUNDIR ]; then
install -d -oi2psvc -m2770 $RUNDIR
fi
cd $RUNDIR
}
start() {
rundir
su - $RUNAS $SCRIPT $RUNOPTS --restart=start
start-stop-daemon --user $RUNAS --exec $SCRIPT --chdir $RUNDIR --make-pidfile $RUNDIR/reseed.pid --start -- $RUNOPTS
}
stop() {
rundir
su - $RUNAS $SCRIPT $RUNOPTS --restart=stop
}
start() {
rundir
su - $RUNAS $SCRIPT $RUNOPTS --restart=restart
start-stop-daemon --user $RUNAS --exec $SCRIPT --chdir $RUNDIR --remove-pidfile $RUNDIR/reseed.pid --stop
}
status() {
rundir
su - $RUNAS $SCRIPT $RUNOPTS --restart=status
start-stop-daemon --user $RUNAS --exec $SCRIPT --chdir $RUNDIR --remove-pidfile $RUNDIR/reseed.pid --status
}
restart() {
stop
start
}
uninstall() {