<commit_before>#!/bin/sh

### BEGIN INIT INFO
# Provides:         ssh-tunnel
# Required-Start:   $remote_fs $syslog
# Required-Stop:    $remote_fs $syslog
# Default-Start:    2 3 4 5
# Default-Stop:
# Short-Description:    SSH tunnel installed by bootstrap rubber-ducky script
### END INIT INFO

NAME=ssh-tunnel
DAEMON=/usr/bin/ssh
DAEMON_ARGS="{{ ssh_user }}@{{ ssh_target }} \
    -i /home/pi/.ssh/id_rsa \
    -N \
    -R 127.0.0.1:2223:127.0.0.1:22 \
    -o BatchMode=yes"{% if no_strict_checking -%} \
    -o StrictHostKeyChecking=no \
    -o UserKnownHostsFile=/dev/null
    {%- endif -%}
DESC="SSH tunnel"
PIDFILE=/var/run/$NAME.pid

. /lib/lsb/init-functions

do_start() {
    start-stop-daemon --status --quiet --pidfile $PIDFILE
    status=$?
    case "$status" in
        0)
            log_action_msg "$DESC already running."
            return 1
            ;;
        1)
            log_warning_msg "$DESC is not running, but pidfile exists. Will try to start."
            ;;
        # 3 means not running, just start as normal
        4)
            log_warning_msg "Could not determine status of $DESC, will try to start."<commit_msg>Wait to acquire ip before trying to connect<commit_after>#!/bin/sh

### BEGIN INIT INFO
# Provides:         ssh-tunnel
# Required-Start:   $remote_fs $syslog
# Required-Stop:    $remote_fs $syslog
# Default-Start:    2 3 4 5
# Default-Stop:
# Short-Description:    SSH tunnel installed by bootstrap rubber-ducky script
### END INIT INFO

NAME=ssh-tunnel
DAEMON=/usr/bin/ssh
DAEMON_ARGS="{{ ssh_user }}@{{ ssh_target }} \
    -i /home/pi/.ssh/id_rsa \
    -N \
    -R 127.0.0.1:2223:127.0.0.1:22 \
    -o BatchMode=yes"{% if no_strict_checking -%} \
    -o StrictHostKeyChecking=no \
    -o UserKnownHostsFile=/dev/null
    {%- endif -%}
DESC="SSH tunnel"
PIDFILE=/var/run/$NAME.pid

. /lib/lsb/init-functions

do_start() {
    sleep 10
    start-stop-daemon --status --quiet --pidfile $PIDFILE
    status=$?
    case "$status" in
        0)
            log_action_msg "$DESC already running."
            return 1
            ;;
        1)
            log_warning_msg "$DESC is not running, but pidfile exists. Will try to start."
            ;;
        # 3 means not running, just start as normal
        4)
            log_warning_msg "Could not determine status of $DESC, will try to start."
{'fraction_non_alphanumeric': 0.129637526652452, 'fraction_numerical': 0.023880597014925373, 'mean_word_length': 2.2493074792243766, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1721407', 'n_tokens_mistral': 872, 'n_tokens_neox': 801, 'n_words': 212}