~gpanders/pushbroom

ref: b446e071502c18f68229531ab7facd116196300b pushbroom/install.sh -rwxr-xr-x 577 bytes
b446e071Greg Anders Update README with options documentation 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash

# Symlink janitor.sh to /usr/local/bin/janitor
if [ ! -L $HOME/.janitor.sh ]; then
    echo "Creating symlinks."
    ln -s $(pwd)/janitor.sh $HOME/.janitor.sh 
fi

# Create crontab
CRONTAB="$(crontab -l 2>/dev/null)"
if [ $? -ne 0 ]; then
    # No existing crontab
    echo "Creating crontab entry."
    crontab crontab
elif [[ $CRONTAB != *"$(cat crontab)" ]]; then
    # Crontab exists but does not already contain ours
    echo "Creating crontab entry."
    (crontab -l ; cat crontab) | crontab -
fi

mkdir -p logs

echo "Installation complete."
exit 0