Skip to content

Instantly share code, notes, and snippets.

@novium
Forked from ViViDboarder/install-user-mosh.sh
Last active January 6, 2018 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save novium/27aac0c3cb4f72cdeba9efa0833a84c1 to your computer and use it in GitHub Desktop.
Save novium/27aac0c3cb4f72cdeba9efa0833a84c1 to your computer and use it in GitHub Desktop.
Mosh is great, but sometimes the remote server you're accessing doesn't have it installed or doesn't give you sudo access. This script will install mosh as a user.
#! /bin/bash
# Make a directory to hold local libs and bins
mkdir -p ~/usr/local
# Get protobuf
wget https://github.com/google/protobuf/archive/v2.5.0.tar.gz
# Extract protobuf
mv v2.5.0.tar.gz protobuf-2.5.0.tar.gz
tar -xvzf protobuf-2.5.0.tar.gz
cd protobuf-2.5.0
# Configure and install
./configure --prefix=$HOME/usr/local && make && make check && make install
if [ $? -ne 0 ]; then
echo "Error compiling protobuf"
exit 1
fi
# Exit the protobuf directory
cd ..
# Clone mosh
git clone --depth 1 https://github.com/keithw/mosh
cd mosh
# Set the path for pkgconfig
export PKG_CONFIG_PATH=$HOME/usr/local/lib/pkgconfig
export PATH=$HOME/usr/local/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/usr/local/lib
# Do the configure and install
./autogen.sh
./configure --prefix=$HOME/usr/local && make && make install
echo ""
echo "Make sure the following lines are in your bashrc"
echo 'export PATH=$HOME/usr/local/bin:$PATH'
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/usr/local/lib'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment