diff --git a/README.mkdn b/README.mkdn index e723d1e..a59a800 100644 --- a/README.mkdn +++ b/README.mkdn @@ -1,4 +1,4 @@ -Swordrune10's Debian/Ubuntu Scripts +Swordrune10's Redhat/Fedora Scripts ------------------------- diff --git a/app/addpkg b/app/addpkg index 310e501..a1da332 100755 --- a/app/addpkg +++ b/app/addpkg @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -sudo apt-get install $@ +sudo yum install $@ diff --git a/app/addrepo b/app/addrepo index 4f2cb18..7546651 100755 --- a/app/addrepo +++ b/app/addrepo @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -sudo add-apt-repository "$@" +sudo yum-config-manager --add-repo "$@" diff --git a/app/addrpmfusion b/app/addrpmfusion new file mode 100755 index 0000000..abd947e --- /dev/null +++ b/app/addrpmfusion @@ -0,0 +1,30 @@ +#!/bin/bash +# Copyright (C) 2014 Sean Donovan + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +yumrepo=$(echo "/etc/yum.repos.d") + +if ( find $yumrepo/rpmfusion-free.repo -maxdepth 1 &> /dev/null); then + echo "rpmfusion free already installed!" +else + echo "installing rpmfusion free" + sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +fi + +if ( find $yumrepo/rpmfusion-nonfree.repo -maxdepth 1 &> /dev/null); then + echo "rpmfusion nonfree already installed!" +else + echo "installing rpmfusion nonfree" + sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm +fi diff --git a/app/mkdvd b/app/mkdvd index 69c92f0..80c9a7a 100755 --- a/app/mkdvd +++ b/app/mkdvd @@ -14,16 +14,9 @@ # limitations under the License. echo "Checking if prerequisites are installed" -for f in `echo mplayer` `echo movie-to-dvd` `echo dvdauthor` `echo genisoimage` `echo libxvidcore4` +for f in `echo ffmpeg` `echo dvdauthor` `echo genisoimage` do - if [ $f == "libxvidcore4" ]; then - if ( ! locate libxvidcore4 &> /dev/null ); then - needsinstall="$needsinstall $f" - fi - elif ( ! type -a $f &> /dev/null ); then - if [ $f == "movie-to-dvd" ]; then - f="videotrans" - fi + if ( ! type -a $f &> /dev/null ); then needsinstall="$needsinstall $f" fi done @@ -31,8 +24,11 @@ done if [ ! "$needsinstall" ]; then echo "All prerequisites are already installed" else + echo "Adding necessary repo" + addrpmfusion + echo "Some prerequisites needs to be installed" - sudo apt-get install $needsinstall + sudo yum install $needsinstall fi videostandard () { @@ -41,10 +37,10 @@ read videostandard if [ $videostandard == "NTSC" ] || [ $videostandard == "ntsc" ]; then export VIDEO_FORMAT=NTSC - movietodvdstandard=ntsc + movietodvdstandard=ntsc-dvd elif [ $videostandard == "PAL" ] || [ $videostandard == "pal" ]; then export VIDEO_FORMAT=PAL - movietodvdstandard=pal + movietodvdstandard=pal-dvd else echo "You did not type in the correct response! try again.." echo "" @@ -66,9 +62,7 @@ cd "$whereisvideo"/temp movietitle=$(echo "$moviefile" | sed s/\.[^\.]*$//) -movie-to-dvd -m $movietodvdstandard -o . ../"$moviefile" - -mplex -f 8 -o "$movietitle".mpg "$movietitle".m2v "$movietitle".ac3 +ffmpeg -i ../"$moviefile" -qscale 1 -vf "scale=640:-1" -target $movietodvdstandard "$movietitle".mpg dvdauthor -o dvd/ -t "$movietitle".mpg diff --git a/app/removepkg b/app/removepkg index 400be4d..43bc915 100755 --- a/app/removepkg +++ b/app/removepkg @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -sudo apt-get remove $@ +sudo yum remove $@ diff --git a/app/removerepo b/app/removerepo index 7177855..48c9852 100755 --- a/app/removerepo +++ b/app/removerepo @@ -13,4 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -sudo add-apt-repository --remove "$@" +cd /etc/yum.repos.d +sudo rm -rf "$@" diff --git a/app/torrentmaker b/app/torrentmaker index 85102f6..48f9769 100755 --- a/app/torrentmaker +++ b/app/torrentmaker @@ -23,7 +23,7 @@ if [ ! "$needsinstall" ]; then echo "All prerequisites are already installed" else echo "A prerequisites needs to be installed" - sudo apt-get install $needsinstall + sudo yum install $needsinstall fi echo "You want to make a webseeder?" diff --git a/app/update b/app/update index 3ffe4e6..446572a 100755 --- a/app/update +++ b/app/update @@ -13,7 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -sudo apt-get update -sudo apt-get --allow-unauthenticated dist-upgrade -sudo apt-get autoclean -sudo apt-get autoremove +sudo yum upgrade diff --git a/server/limitbandwidth b/server/limitbandwidth index b953249..c3b03b0 100755 --- a/server/limitbandwidth +++ b/server/limitbandwidth @@ -23,7 +23,7 @@ if [ ! "$needsinstall" ]; then echo "All prerequisites are already installed" else echo "A prerequisites needs to be installed" - sudo apt-get install $needsinstall + sudo yum install $needsinstall fi if [ "$1" == "clear" ]; then diff --git a/server/nitenite b/server/nitenite index ab8598a..3b8a515 100755 --- a/server/nitenite +++ b/server/nitenite @@ -14,19 +14,16 @@ # limitations under the License. main() { -clear -cd ~ echo "How long would you like the computer to sleep for?" echo "Type list to see a list of units of time supported" echo "Type exit to leave program" echo "Example = 10 hours" read decision -#if what was typed had any upper case letters convert it -#to lower case into another file and then rewrite the -#variable with the modification +#if what was typed had any upper case letters convert it +#to lower case -if ( echo $decision | grep -q [A-Z] );then +if ( echo $decision | grep -q [A-Z] );then decision=$(echo $decision | sed -e 's/\(.*\)/\L\1/') fi @@ -37,15 +34,14 @@ length=$(echo $decision | sed 's/[^a-z]*//g') #exit if; quit program immediately if told to do so, easy way to work on this script -if [ $length == "exit" ]; then - clear +if [ "$length" == "exit" ]; then echo "Program Terminated" exit 0 fi #list if; type list and u get all the units in a list! amazing! -if [ $length == "list" ]; then +if [ "$length" == "list" ]; then echo "" echo "All supported units of time is:" echo "seconds, minutes, hours, days, weeks, fortnights," @@ -55,8 +51,7 @@ if [ $length == "list" ]; then fi #this checks to see if what was typed had any numbers in -#it, and if it doesnt the script will delete all unnecessary files -#and terminate early +#it, and if it doesnt the script will start over if ( ! echo $time | grep -q [0-9]); then echo "" @@ -65,8 +60,8 @@ if ( ! echo $time | grep -q [0-9]); then main fi -#the beginning of all the if statements to figure out how to calculate the results, -#it uses the unit of time specified to determine the length of the +#the beginning of all the if statements to figure out how to calculate the results, +#it uses the unit of time specified to determine the length of the #effect the user wants #seconds if; easy @@ -113,7 +108,7 @@ if [ $length == "month" ] || [ $length == "months" ]; then fi #years if; because of the calculated disaster of months i had to use the only -#one that wasnt a decimal, which is ironically the actual answer of seconds +#one that wasnt a decimal, which is ironically the actual answer of seconds #there is in a year x.x #after this it will go back to just multiplying from this diff --git a/server/restartapache b/server/restartapache index dde5a28..c1e7273 100755 --- a/server/restartapache +++ b/server/restartapache @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -sudo /etc/init.d/apache2 restart +sudo service httpd restart diff --git a/server/ubuonestop b/server/setuplamp similarity index 74% rename from server/ubuonestop rename to server/setuplamp index f90b36a..b1c954b 100755 --- a/server/ubuonestop +++ b/server/setuplamp @@ -13,4 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -u1sdtool --quit +sudo yum install httpd mysql mysql-server php php-mysql + +sudo /usr/bin/mysql_secure_installation + +sudo service httpd start +sudo service mysqld start + +sudo chkconfig httpd on +sudo chkconfig mysqld on diff --git a/server/ubuonesync b/server/ubuonesync deleted file mode 100755 index 00f1786..0000000 --- a/server/ubuonesync +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Sean Donovan - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -watch -n .1 u1sdtool --current-transfers diff --git a/setupbin b/setupbin index 325dfd5..7d3d4ab 100755 --- a/setupbin +++ b/setupbin @@ -13,14 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -cd ~ -if ( grep -q HOME/bin/android .profile );then - echo ".profile doesn't need to be patched" -fi -if ( ! grep -q HOME/bin/android .profile ) && ( find $HOME/bin/private &> /dev/null );then - sed -i '/PATH"/ a\ PATH="$HOME/bin/android:$HOME/bin/app:$HOME/bin/private:$HOME/bin/server:$PATH"' .profile - echo "patched .profile" +if ( grep -q HOME/bin/android $HOME/.bash_profile ); then + echo ".bash_profile doesn't need to be patched" else - sed -i '/PATH"/ a\ PATH="$HOME/bin/android:$HOME/bin/app:$HOME/bin/server:$PATH"' .profile - echo "patched .profile" + sed -i '/PATH"/ a\ PATH="$HOME/bin/android:$HOME/bin/app:$HOME/bin/server:$PATH"' $HOME/.bash_profile + echo "patched .bash_profile" +fi + +if ( ! grep -q HOME/bin/private $HOME/.bash_profile ) && ( find $HOME/bin/private &> /dev/null ); then + sed -i '/PATH="$HOME\/bin\/android/ a\ PATH="$HOME/bin/private:$PATH"' $HOME/.bash_profile + echo "patched .bash_profile to include private" fi