Skip to content

Instantly share code, notes, and snippets.

@kwcto
Forked from mschwartz/Run Script.sh
Last active February 20, 2016 23:16
Show Gist options
  • Select an option

  • Save kwcto/8ca4c7c6fd6b613b5d42 to your computer and use it in GitHub Desktop.

Select an option

Save kwcto/8ca4c7c6fd6b613b5d42 to your computer and use it in GitHub Desktop.

Revisions

  1. Will Sahatdjian revised this gist Jan 7, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Run Script.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    INFOPLIST="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
    echo "writing to $INFOPLIST"
    PLISTCMD="Add :SERVER_IP string $(ifconfig | head -30 | grep inet\ | tail -1 | cut -d " " -f 2)"
    PLISTCMD="Add :SERVER_IP string $(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | head -1)"
    echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true
    PLISTCMD="Set :SERVER_IP $(ifconfig | head -30 | grep inet\ | tail -1 | cut -d " " -f 2)"
    PLISTCMD="Set :SERVER_IP $(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | head -1)"
    echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true
  2. Will Sahatdjian revised this gist Jan 7, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Run Script.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    INFOPLIST="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
    echo "writing to $INFOPLIST"
    PLISTCMD="Add :SERVER_IP string $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)"
    echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true
    PLISTCMD="Set :SERVER_IP $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)"
    PLISTCMD="Add :SERVER_IP string $(ifconfig | head -30 | grep inet\ | tail -1 | cut -d " " -f 2)"
    echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true
    PLISTCMD="Set :SERVER_IP $(ifconfig | head -30 | grep inet\ | tail -1 | cut -d " " -f 2)"
    echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true
  3. @mschwartz mschwartz renamed this gist Nov 20, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. @mschwartz mschwartz revised this gist Nov 20, 2015. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,6 @@
    ```sh
    INFOPLIST="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
    echo "writing to $INFOPLIST"
    PLISTCMD="Add :SERVER_IP string $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)"
    echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true
    PLISTCMD="Set :SERVER_IP $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)"
    echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true
    ```
  5. @mschwartz mschwartz created this gist Nov 20, 2015.
    8 changes: 8 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    ```sh
    INFOPLIST="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
    echo "writing to $INFOPLIST"
    PLISTCMD="Add :SERVER_IP string $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)"
    echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true
    PLISTCMD="Set :SERVER_IP $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)"
    echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true
    ```