Skip to content

Instantly share code, notes, and snippets.

@zanculmarktum
Created March 15, 2018 01:50
Show Gist options
  • Select an option

  • Save zanculmarktum/7a2a854d146e4018587041584d9ddd59 to your computer and use it in GitHub Desktop.

Select an option

Save zanculmarktum/7a2a854d146e4018587041584d9ddd59 to your computer and use it in GitHub Desktop.

Revisions

  1. zanculmarktum created this gist Mar 15, 2018.
    28 changes: 28 additions & 0 deletions telkampret.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    #!/bin/sh

    # Adds a telkampret connection to NetworkManager.

    if [ "$(id -u)" != "0" ]; then
    echo "${0##*/}: super user access required" >&2
    exit 1
    fi

    if ! which nmcli >/dev/null 2>&1; then
    echo "${0##*/}: NetworkManager is not installed" >&2
    exit 1
    fi

    if nmcli c show telkampret >/dev/null 2>&1; then
    echo "${0##*/}: telkampret: connection already exists" >&2
    exit 1
    fi

    nmcli c add \
    type gsm \
    ifname '*' \
    con-name telkampret \
    autoconnect no \
    apn telkomsel \
    user wap \
    password wap123 \
    gsm.number '*99#'