Skip to content

Commit

Permalink
Improve install script
Browse files Browse the repository at this point in the history
  • Loading branch information
coditva committed Feb 21, 2017
1 parent eeff23d commit 9fd095b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions install
Original file line number Diff line number Diff line change
@@ -1,41 +1,49 @@
#!/bin/sh

echo "Installing BITSnet Login"

# Check if wget installed
echo "Checking if wget installed"
if ! which wget > /dev/null ; then
echo "wget not installed"
exit
fi
# Check if git installed for update
echo "Checking if git installed"
if ! which git > /dev/null ; then
echo "git not installed"
exit
fi
# Check if nmcli installed
echo "Checking if nmcli installed"
if ! which nmcli > /dev/null ; then
echo "nmcli not installed"
exit
fi

# Copy config file to the right place
if ! ls -a ~ | grep .bitsnetrc > /dev/null ; then
if ! ls -a ~ | grep -x ".bitsnetrc" --quiet ; then
echo "Copying bitsnetrc"
cp ./bitsnetrc ~/.bitsnetrc
fi

# Copy the script to executables
if [ ! -d ~/.local/lib/bitsnet ]; then
mkdir ~/.local/lib/bitsnet
fi
echo "Copying script"
cp ./util.sh ~/.local/lib/bitsnet/util.sh
cp ./bitsnet ~/.local/bin/bitsnet

# Create a desktop file
echo "Creating app launcher"
cp ./bitsnet.desktop ~/.local/share/applications/bitsnet.desktop

# Set to autostart
echo "Setting up autologin"
if [ ! -d ~/.config/autostart ]; then
mkdir -p ~/.config/autostart
fi
ln -sf ~/.local/share/applications/bitsnet.desktop ~/.config/autostart/bitsnet.desktop

# Create a man page
# To Be Done
# TODO: Create a man page

0 comments on commit 9fd095b

Please sign in to comment.