Are you a spammer

Please note, that the first 3 posts you make, will need to be approved by a forum Administrator or Moderator before they are publicly viewable.
Each application to join this forum is checked at the Stop Forum Spam website. If the email or IP address appears there when checked, you will not be allowed to join this forum.
If you get past this check and post spam on this forum, your posts will be immediately deleted and your account inactivated.You will then be banned and your IP will be submitted to your ISP, notifying them of your spamming. So your spam links will only be seen for an hour or two at most. In other words, don't waste your time and ours.

This forum is for the use and enjoyment of the members and visitors looking to learn about and share information regarding the topics listed. It is not a free-for-all advertising venue. Your time would be better spent pursuing legitimate avenues of promoting your websites.

Auto Repo script

Source code I have written openly published for your viewing pleasure.


Auto Repo script

Postby TheeMahn » Fri Dec 21, 2007 3:59 pm

I wrote this script a long time ago, it has been revised many times, the script checks for a newer version on my server to ensure everyone utilizing it reaps the benefits as I revise it. Without further interruption onto the code:

Code: Select all
#!/bin/bash
# Auto - Repository generator Via TheeMahn
#
# Copyright (c) 2007  Ubuntusoftware Team <http://ubuntusoftware.info>
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
SCRIPT_VERSION=1.00
##Check for zenity

if [ ! -e "/usr/bin/zenity" ]; then
   gksudo apt-get install -y zenity
fi

update() {
 wget -O /tmp/autorepo http://ubuntusoftware.info/scripts/autorepo >/dev/null 2>&1
 REMOTE_VERSION=`grep SCRIPT_VERSION /tmp/autorepo |head -n1 |sed 's/.*=//'`
 if [ "$REMOTE_VERSION" != "$SCRIPT_VERSION" ]; then
  if [[ -n $DIALOG ]]
  then
   dialog --yesno "Newer version of Auto Repo has been found\n\nDo you wish to install it?" 0 0
   DIALOG_EXIT_CODE=$?
   if [[ $DIALOG_EXIT_CODE = 0 ]]
   then
    cp /tmp/autorepo ~/.gnome2/nautilus-scripts/
    echo "Auto_Repo script has been updated to v $REMOTE_VERSION"
    echo "Please re-run the script"
    zenity --info --text='Newer version of script detected '$REMOTE_VERSION'.  It has been upgraded please re-run script.' --title="Auto Repo";
    exit
   fi
  else
   cp /tmp/autorepo ~/.gnome2/nautilus-scripts/
   echo "Newer version detected: $REMOTE_VERSION"
   zenity --info --text='Newer version of script detected '$REMOTE_VERSION'.  It has been upgraded please re-run script.' --title="Auto Repo";
   exit
  fi
 fi
 rm /tmp/autorepo 2>/dev/null
}
update
PROGRESS=0
cd $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
NUMBER_OF_FILES=`find -iname "*.deb" -maxdepth 1 | wc -l`
zenity --info --title "Repo Manager" --text "There is "$NUMBER_OF_FILES" packages to index in "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"."
sudo dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz | zenity --width=600 --height=100 --progress --pulsate --auto-close --title="Scaning Packages..."
sudo dpkg-scansources . /dev/null | gzip -9c > Sources.gz | zenity --width=600 --height=100 --progress --auto-close --title="Scaning Sources..."


I will come back and explain in detail of each command (time permitting), I am here to educate. This script is what makes http://repoubuntusoftware.info not solely yet but coming.
Home of Ultimate Edition. Got a question? Please review the F.A.Q. Browse the How to section.

Main O/S: Builder of O/S Guess.
Mainboard: ASUS Hero VI (AM4)
CPU: AMD 1700X water cooled (Deepcool Captain Genome Cooling tower)
Ram: 16 GB GSkill Trident RGB Series Dual Channel DDR4 3200
Video: MSI RX470 8GB Gaming card.
Hard Disks: MASSIVE on the network.(10 Gigabit, 48 port, multiple servers)
Monitors: Dual 4K 43" LG, 4K Samsung 28"
750 Watt modular PSU (Rosswell)
1100 Watt Amp & 4 X 600 Watt speakers

Servers in the basement.
User avatar
TheeMahn
Site Admin
 
Posts: 4201
Joined: Fri Oct 12, 2007 10:02 am
Location: U.S.A.
Age: 53
Operating System: Ultimate Edition Developer

Return to Programming

Who is online

Users browsing this forum: No registered users and 24 guests