Here is a more general, but still easy solution for this problem:
for oldName in `find . -name "*.*.*"`; do newName=`echo $oldName | rev | cut -f2- -d'.' | rev`; mv $oldName $newName; done
Short explanation:
find . -name "*.*.*
- this will find only the files with duplicate extensions recursively
echo $oldName | rev | cut -f2- -d'.' | rev
- the trick happens here: the rev command do a reverse on the string, so you now you can see, that you want the whole filename from the first dot. (gpj.gpj.fdsa)
mv $oldName $newName
- to actually rename the files
Release Notes: since it is a simple one-line script, you can find unhandled cases. Files with an extra dot in the filename, super-deep directory structures, etc.