403Webshell
Server IP : 134.236.49.22  /  Your IP : 216.73.216.114
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/bin/f-spot-sqlite-upgrade
#!/bin/sh
set -e

# This only upgrades the default database location
# if you have specified a different location 
if [ ! -n "$XDG_CONFIG_HOME" ]; then
	XDG_CONFIG_HOME="$HOME/.config"
fi
DB_LOCATION="$XDG_CONFIG_HOME/f-spot/photos.db"
BACKUP_LOCATION=$DB_LOCATION.backup
DUMP_LOCATION=$DB_LOCATION.dump
NEW_DB_LOCATION=$DB_LOCATION.new

if ! which sqlite >/dev/null 2>&1 ; then
	echo "Could not find sqlite binary. Update aborted." >&2
	exit 1
elif ! which sqlite3 >/dev/null 2>&1 ; then
	echo "Could not find sqlite3 binary. Update aborted." >&2
	exit 1
fi

if [ ! -f $DB_LOCATION ]; then
	echo "Could not find $DB_LOCATION, nothing to update. Update aborted." >&2
	exit 1
fi

# make sure nothing gets in the way
rm -f $BACKUP_LOCATION
rm -f $DUMP_LOCATION
rm -f $NEW_DB_LOCATION

if grep "^...This file contains an SQLite 2.1 database" $DB_LOCATION >/dev/null 2>&1; then
	echo "Upgrading from SQLite 2.1 to SQLite3"
	cp $DB_LOCATION $BACKUP_LOCATION
	if sqlite $DB_LOCATION .dump > $DUMP_LOCATION &&
	   sqlite3 $NEW_DB_LOCATION < $DUMP_LOCATION; then
		cp $NEW_DB_LOCATION $DB_LOCATION
		echo "Upgrade was successful."
	else
		echo "Upgrade failed, putting old database back." >&2
		cp $BACKUP_LOCATION $DB_LOCATION
		exit 1
	fi
else
	echo "Database is already upgraded"
fi

Youez - 2016 - github.com/yon3zu
LinuXploit