-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrcasts
executable file
·30 lines (27 loc) · 942 Bytes
/
rcasts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
if [ `id -u` = 0 ]; then
echo "rcasts launched by root, will exit now"
echo "please launch as normal user"
exit 0
fi
URL="https://raw.github.com/4freaks/Utilites/master"
if [ "$1" = "" ]; then
echo "rcasts need parameter"
elif [ "$1" = "upgrade" ]; then
sudo wget -Nq $URL/rcasts -O /usr/bin/rcasts && sudo chmod +x /usr/bin/rcasts
exit 0
elif [ "$1" = "help" ]; then
curl -s $URL/README
elif [ "$1" = "backup" ]; then
curl -s $URL/$1 | ruby
elif [ "$1" = "rcstyle" ]; then
wget -Nq $URL/rbeautify.rb -O /usr/bin/rcstyle && chmod +x /usr/bin/rcstyle && echo "rcstyle installed, now you can run it with rcstyle file.rb"
elif [ "$1" = "style.rb" ]; then
wget -Nq $URL/rbeautify.rb -O temp_style_script.rb && chmod +x temp_style_script.rb
find . -type f -iname "*.rb" -exec ./temp_style_script.rb {} \;
rm temp_style_script.rb
else
cd /tmp && wget -Nq $URL/$1 && chmod +x $1
./$1
rm $1
fi