1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-10 10:04:21 +01:00

Merge pull request #13 from fredefox/fix-install-script

Fix install script
This commit is contained in:
Viktor Stanchev 2014-03-03 11:13:13 -05:00
commit de3205a37b
2 changed files with 18 additions and 23 deletions

View File

@ -1,24 +1,23 @@
#!/usr/bin/env sh
if [ "$UID" -ne 0 ]
then echo "Please run as root"
exit
fi
set -e
TMP=$(mktemp pirate-get-XXX)
if [ $(which python2.7) ]
then
echo "#!/usr/bin/env python2.7" > "$TMP"
elif [ `which python2` ]
then
echo "#!/usr/bin/env python2" > "$TMP"
else
echo "#!/usr/bin/env python" > "$TMP"
fi
{
if [ $(which python2.7) ]
then
echo "#!/usr/bin/env python2.7" > "$TMP"
elif [ `which python2` ]
then
echo "#!/usr/bin/env python2" > "$TMP"
else
echo "#!/usr/bin/env python" > "$TMP"
fi
sed 1d $(dirname $0)/pirate-get.py >> "$TMP"
cp "$TMP" /usr/bin/pirate-get
chmod +x /usr/bin/pirate-get
chmod 755 /usr/bin/pirate-get
rm "$TMP"
cp "$TMP" /usr/bin/pirate-get &&
chmod +x /usr/bin/pirate-get &&
chmod 755 /usr/bin/pirate-get &&
rm $TMP
} || rm $TMP

View File

@ -1,7 +1,3 @@
#!/usr/bin/env sh
if [ "$UID" -ne 0 ]
then echo "Please run as root"
exit
fi
set -e
rm /usr/bin/pirate-get