#!/bin/sh

# simple installation script which copies files to their correct locations
# in order to function correctly.  keep in mind, you're going to need to
# be root to use this script. ;)

checkforroot() {
        if [ "$EUID" -ne 0 ]; then
                echo "You must be root to install this package."
                exit 1
        fi
}

checkforroot

clear
echo Copying files to /etc/ppp and setting permissions...
install -c -o root -g root -m 644 README /etc/ppp
install -c -o root -g root -m 600 chap-secrets /etc/ppp
install -c -o root -g root -m 755 connect /etc/ppp
install -c -o root -g root -m 644 options /etc/ppp
install -c -o root -g root -m 600 pap-secrets /etc/ppp
install -c -o root -g root -m 700 ppp /etc/ppp
install -c -o root -g root -m 700 ppp.down /etc/ppp
install -c -o root -g root -m 700 ppp.minicom /etc/ppp
install -c -o root -g root -m 700 uninstallme /etc/ppp

echo Linking /etc/ppp/connect to /usr/local/sbin/ppp-up ...
ln -s /etc/ppp/connect /usr/local/sbin/ppp-up 
echo Linking /etc/ppp/ppp.down to /usr/local/sbin/ppp-down ...
ln -s /etc/ppp/ppp.down /usr/local/sbin/ppp-down
echo
echo PPP-in-a-box installed, be sure to edit /etc/ppp/pap-secrets,
echo /etc/ppp/chap-secrets, and /etc/ppp/ppp to configure this program for
echo your ISP.
echo
