Skip to content

Commit

Permalink
better script
Browse files Browse the repository at this point in the history
  • Loading branch information
whackashoe committed Jan 12, 2015
1 parent f17a953 commit 7f4fcbc
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions app/database/seeds/PastesTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,22 @@ public function run()
{
Paste::create([
'slug' => 'about',
'code' => "
about killr.io
===
share code or get beat.
#!/bin/sh
curl -X POST --data-binary @$1 https://killr.io
save that to killr.sh.
run chmod +x killr.sh
now do ./killr.sh ~/code/filetoshare
convenient eh?
"
'code' => '
#!/bin/bash
stdin="$(ls -l /proc/self/fd/0)"
stdin="${stdin/*-> /}"
if [[ "$stdin" =~ ^/dev/pts/[0-9] ]]; then
if [ $# -eq 0 ]
then
echo "No filename supplied"
else
curl -X POST --data-binary @$1 http://killr.io
fi
else
curl -X POST --data-binary @- http://killr.io
fi
'
]);

Paste::create([
Expand Down

0 comments on commit 7f4fcbc

Please sign in to comment.