Anineko/install

68 lines
1.7 KiB
Text
Raw Normal View History

2014-12-14 22:12:31 +00:00
#!/bin/bash
2015-01-03 18:23:29 +00:00
# Copyright 2014 overflowerror (https://github.com/overflowerror/)
#
# This file is part of Anineko.
#
# Anineko is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Anineko is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Anineko. If not, see <http://www.gnu.org/licenses/>.
2014-12-14 22:12:31 +00:00
echo "Welcome to the Anineko install/update-script."
if test $(id -u) != 0; then
echo "Error: Not permitted. You need to be root in order to execute this script."
exit 2
fi
check() {
text=" $1..."
2014-12-14 22:40:48 +00:00
echo -n $text
2014-12-14 22:12:31 +00:00
for i in $(seq ${#text} 20); do
echo -n " "
done
which $1 2>&1 > /dev/null
if test $? = 0; then
echo -e "[ \033[32mpass\033[0m ]"
return 0
else
echo -e "[ \033[31mfail\033[0m ]"
echo "Please resolve dependency problemes and retry."
exit 3
fi
}
echo
echo "Checking dependencies..."
check wget
check grep
check egrep
check sed
check awk
2014-12-14 22:19:41 +00:00
check md5sum
2015-03-28 12:57:15 +00:00
check python2
2014-12-16 17:08:27 +00:00
check tee
2014-12-21 23:13:42 +00:00
check bc
2014-12-14 22:12:31 +00:00
echo
echo "The latest version of Anineko will now be downloaded to /usr/bin/."
2014-12-14 22:37:52 +00:00
echo "Press [enter] to continue. Press [ctrl] + C to abort."
2014-12-14 22:12:31 +00:00
read
wget -O /usr/bin/anineko "https://raw.githubusercontent.com/overflowerror/Anineko/master/anineko" --progress=bar:force 2>&1 | tail -f -n +12
2014-12-14 22:42:59 +00:00
chmod o+x /usr/bin/anineko
2014-12-14 22:12:31 +00:00
echo
echo "Download complete. Have fun with Anineko. :3"
exit 0