2013-12-14 14:43:10 +01:00
|
|
|
#!/usr/bin/env sh
|
2014-01-31 23:15:47 +01:00
|
|
|
|
2013-12-14 14:12:17 +01:00
|
|
|
if [ "$UID" -ne 0 ]
|
|
|
|
then echo "Please run as root"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2014-01-31 23:15:47 +01:00
|
|
|
TMP=$(mktemp pirate-get-XXX)
|
|
|
|
if [ $(which python2.7) ]
|
2013-12-14 14:12:17 +01:00
|
|
|
then
|
2014-01-31 23:15:47 +01:00
|
|
|
echo "#!/usr/bin/env python2.7" > "$TMP"
|
2013-12-14 14:12:17 +01:00
|
|
|
elif [ `which python2` ]
|
|
|
|
then
|
2014-01-31 23:15:47 +01:00
|
|
|
echo "#!/usr/bin/env python2" > "$TMP"
|
2013-12-14 14:12:17 +01:00
|
|
|
else
|
2014-01-31 23:15:47 +01:00
|
|
|
echo "#!/usr/bin/env python" > "$TMP"
|
2013-12-14 14:12:17 +01:00
|
|
|
fi
|
|
|
|
|
2014-01-31 23:15:47 +01:00
|
|
|
sed 1d $(dirname $0)/pirate-get.py >> "$TMP"
|
2013-12-14 14:12:17 +01:00
|
|
|
|
2014-01-31 23:15:47 +01:00
|
|
|
cp "$TMP" /usr/bin/pirate-get
|
2013-12-14 14:12:17 +01:00
|
|
|
chmod +x /usr/bin/pirate-get
|
|
|
|
chmod 755 /usr/bin/pirate-get
|
2014-01-31 23:15:47 +01:00
|
|
|
rm "$TMP"
|