{"action":"created","comment":{"url":"https://api.github.com/repos/lordkator/ZonamaDev/pulls/comments/81960484","pull_request_review_id":2884829,"id":81960484,"diff_hunk":"@@ -655,6 +665,98 @@ server_backup() {\n     return 0\n }\n \n+server_backup_chooser()\n+{\n+    cd ~/server/swgemu/backups/\n+\n+    options=( $(find -maxdepth 1 -name \"*tar.gz\" -printf \"%f\\n\" | sort | xargs -0) )\n+    prompt=\"Please select a file:\"\n+\n+    PS3=$'\\n'\"$prompt \"\n+    select opt in \"${options[@]}\" \"Quit\" ; do\n+        echo $opt\n+        exit\n+    done\n+}\n+\n+server_restore()\n+{\n+    BUDIR=~/server/swgemu/backups\n+\n+    if server_status; then\n+        echo \"** SERVER IS RUNNING **\"\n+\n+        if yorn \"Would you like to shutdown the server first?\"; then\n+            server_stop\n+        else\n+            echo \"** USER ABORTED RESTORE **\"\n+            return 12\n+        fi\n+   fi\n+\n+    last_bu=$BUDIR/$(server_backup_chooser)\n+    local bu_filename=$(basename \"${last_bu}\")\n+\n+    if [ \"${bu_filename}\" == \"Quit\" ]; then\n+        echo \"** USER ABORTED RESTORE **\"\n+        return 12\n+    elif yorn \"Would you like to restore \"${bu_filename}\"?\"; then\n+        :\n+    else\n+        echo \"** USER ABORTED RESTORE **\"\n+        exit\n+    fi\n+\n+    #TODO - Should call server_backup maybe with a flag to use a special name like \"prerestore\" or something\n+    #WIP - create a prerestore backup in case things get messed up\n+    prerest=true\n+    server_backup\n+\n+    echo \"** RESTORING \" ${last_bu}\" **\"\n+    local restat=$(mktemp /tmp/swgemu-recovery-status.XXXXXX)\n+\n+    (\n+        trap 'st=$?;echo \"$st\" > \"'\"${restat}\"'\";echo \"** UNEXPECTED EXIT=$st, CANNOT RESTORE **\"' 0\n+\n+\t    echo 254 > \"${restat}\"\n+\n+        set -e\n+        cd \"${RUN_DIR}\"\n+        rm -fr databases && mkdir databases\n+\n+        cd \"${RUN_DIR}/..\"\n+        tar xvf $last_bu\n+\n+        mysql -e 'DROP DATABASE swgemu'\n+        mysql -e 'CREATE DATABASE swgemu'\n+        mysql swgemu < mysqldump.sql\n+\n+        trap - 0\n+\n+    echo 0 > \"${restat}\"\n+    )\n+\n+    local res=$(<\"${restat}\")\n+\n+    rm -f \"${restat}\"\n+\n+    if [[ $res -ne 0 ]]; then\n+\t    echo \"** ERROR: Backup failed with status ${res} **\"\n+\t    return ${res}\n+    fi\n+\n+    echo \"** BACKUP SUCCESSFULLY RECOVERED **\"","path":"fasttrack/bin/swgemu","position":132,"original_position":132,"commit_id":"288aa5bd016cf170b48ae6ba461ab084ba341478","original_commit_id":"288aa5bd016cf170b48ae6ba461ab084ba341478","user":{"login":"karlbunch","id":249481,"avatar_url":"https://avatars.githubusercontent.com/u/249481?v=3","gravatar_id":"","url":"https://api.github.com/users/karlbunch","html_url":"https://github.com/karlbunch","followers_url":"https://api.github.com/users/karlbunch/followers","following_url":"https://api.github.com/users/karlbunch/following{/other_user}","gists_url":"https://api.github.com/users/karlbunch/gists{/gist_id}","starred_url":"https://api.github.com/users/karlbunch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlbunch/subscriptions","organizations_url":"https://api.github.com/users/karlbunch/orgs","repos_url":"https://api.github.com/users/karlbunch/repos","events_url":"https://api.github.com/users/karlbunch/events{/privacy}","received_events_url":"https://api.github.com/users/karlbunch/received_events","type":"User","site_admin":false},"body":"RECOVERED => \"RESTORED\"\r\n\r\n","created_at":"2016-10-05T12:26:35Z","updated_at":"2016-10-05T12:26:35Z","html_url":"https://github.com/lordkator/ZonamaDev/pull/178#discussion_r81960484","pull_request_url":"https://api.github.com/repos/lordkator/ZonamaDev/pulls/178","_links":{"self":{"href":"https://api.github.com/repos/lordkator/ZonamaDev/pulls/comments/81960484"},"html":{"href":"https://github.com/lordkator/ZonamaDev/pull/178#discussion_r81960484"},"pull_request":{"href":"https://api.github.com/repos/lordkator/ZonamaDev/pulls/178"}}},"pull_request":{"url":"https://api.github.com/repos/lordkator/ZonamaDev/pulls/178","id":86438471,"html_url":"https://github.com/lordkator/ZonamaDev/pull/178","diff_url":"https://github.com/lordkator/ZonamaDev/pull/178.diff","patch_url":"https://github.com/lordkator/ZonamaDev/pull/178.patch","issue_url":"https://api.github.com/repos/lordkator/ZonamaDev/issues/178","number":178,"state":"open","locked":false,"title":"Panel 2 Chrome icon / System Restore & Backup Chooser / 'prerestore' backup with flag","user":{"login":"Farelli","id":16756602,"avatar_url":"https://avatars.githubusercontent.com/u/16756602?v=3","gravatar_id":"","url":"https://api.github.com/users/Farelli","html_url":"https://github.com/Farelli","followers_url":"https://api.github.com/users/Farelli/followers","following_url":"https://api.github.com/users/Farelli/following{/other_user}","gists_url":"https://api.github.com/users/Farelli/gists{/gist_id}","starred_url":"https://api.github.com/users/Farelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Farelli/subscriptions","organizations_url":"https://api.github.com/users/Farelli/orgs","repos_url":"https://api.github.com/users/Farelli/repos","events_url":"https://api.github.com/users/Farelli/events{/privacy}","received_events_url":"https://api.github.com/users/Farelli/received_events","type":"User","site_admin":false},"body":"Edited icon in /.config/xfce4/panel/launcher-11/14509081343.desktop to switch to Google Chrome on unpacking. https://github.com/lordkator/ZonamaDev/issues/54","created_at":"2016-09-23T00:45:27Z","updated_at":"2016-10-05T12:28:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9f158a2fd5332e871706ad7f3ddceb0a7ced746","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/lordkator/ZonamaDev/pulls/178/commits","review_comments_url":"https://api.github.com/repos/lordkator/ZonamaDev/pulls/178/comments","review_comment_url":"https://api.github.com/repos/lordkator/ZonamaDev/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lordkator/ZonamaDev/issues/178/comments","statuses_url":"https://api.github.com/repos/lordkator/ZonamaDev/statuses/288aa5bd016cf170b48ae6ba461ab084ba341478","head":{"label":"Farelli:master","ref":"master","sha":"288aa5bd016cf170b48ae6ba461ab084ba341478","user":{"login":"Farelli","id":16756602,"avatar_url":"https://avatars.githubusercontent.com/u/16756602?v=3","gravatar_id":"","url":"https://api.github.com/users/Farelli","html_url":"https://github.com/Farelli","followers_url":"https://api.github.com/users/Farelli/followers","following_url":"https://api.github.com/users/Farelli/following{/other_user}","gists_url":"https://api.github.com/users/Farelli/gists{/gist_id}","starred_url":"https://api.github.com/users/Farelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Farelli/subscriptions","organizations_url":"https://api.github.com/users/Farelli/orgs","repos_url":"https://api.github.com/users/Farelli/repos","events_url":"https://api.github.com/users/Farelli/events{/privacy}","received_events_url":"https://api.github.com/users/Farelli/received_events","type":"User","site_admin":false},"repo":{"id":68931700,"name":"ZonamaDev","full_name":"Farelli/ZonamaDev","owner":{"login":"Farelli","id":16756602,"avatar_url":"https://avatars.githubusercontent.com/u/16756602?v=3","gravatar_id":"","url":"https://api.github.com/users/Farelli","html_url":"https://github.com/Farelli","followers_url":"https://api.github.com/users/Farelli/followers","following_url":"https://api.github.com/users/Farelli/following{/other_user}","gists_url":"https://api.github.com/users/Farelli/gists{/gist_id}","starred_url":"https://api.github.com/users/Farelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Farelli/subscriptions","organizations_url":"https://api.github.com/users/Farelli/orgs","repos_url":"https://api.github.com/users/Farelli/repos","events_url":"https://api.github.com/users/Farelli/events{/privacy}","received_events_url":"https://api.github.com/users/Farelli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Farelli/ZonamaDev","description":"Development Environment for SWGEMU","fork":true,"url":"https://api.github.com/repos/Farelli/ZonamaDev","forks_url":"https://api.github.com/repos/Farelli/ZonamaDev/forks","keys_url":"https://api.github.com/repos/Farelli/ZonamaDev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Farelli/ZonamaDev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Farelli/ZonamaDev/teams","hooks_url":"https://api.github.com/repos/Farelli/ZonamaDev/hooks","issue_events_url":"https://api.github.com/repos/Farelli/ZonamaDev/issues/events{/number}","events_url":"https://api.github.com/repos/Farelli/ZonamaDev/events","assignees_url":"https://api.github.com/repos/Farelli/ZonamaDev/assignees{/user}","branches_url":"https://api.github.com/repos/Farelli/ZonamaDev/branches{/branch}","tags_url":"https://api.github.com/repos/Farelli/ZonamaDev/tags","blobs_url":"https://api.github.com/repos/Farelli/ZonamaDev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Farelli/ZonamaDev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Farelli/ZonamaDev/git/refs{/sha}","trees_url":"https://api.github.com/repos/Farelli/ZonamaDev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Farelli/ZonamaDev/statuses/{sha}","languages_url":"https://api.github.com/repos/Farelli/ZonamaDev/languages","stargazers_url":"https://api.github.com/repos/Farelli/ZonamaDev/stargazers","contributors_url":"https://api.github.com/repos/Farelli/ZonamaDev/contributors","subscribers_url":"https://api.github.com/repos/Farelli/ZonamaDev/subscribers","subscription_url":"https://api.github.com/repos/Farelli/ZonamaDev/subscription","commits_url":"https://api.github.com/repos/Farelli/ZonamaDev/commits{/sha}","git_commits_url":"https://api.github.com/repos/Farelli/ZonamaDev/git/commits{/sha}","comments_url":"https://api.github.com/repos/Farelli/ZonamaDev/comments{/number}","issue_comment_url":"https://api.github.com/repos/Farelli/ZonamaDev/issues/comments{/number}","contents_url":"https://api.github.com/repos/Farelli/ZonamaDev/contents/{+path}","compare_url":"https://api.github.com/repos/Farelli/ZonamaDev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Farelli/ZonamaDev/merges","archive_url":"https://api.github.com/repos/Farelli/ZonamaDev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Farelli/ZonamaDev/downloads","issues_url":"https://api.github.com/repos/Farelli/ZonamaDev/issues{/number}","pulls_url":"https://api.github.com/repos/Farelli/ZonamaDev/pulls{/number}","milestones_url":"https://api.github.com/repos/Farelli/ZonamaDev/milestones{/number}","notifications_url":"https://api.github.com/repos/Farelli/ZonamaDev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Farelli/ZonamaDev/labels{/name}","releases_url":"https://api.github.com/repos/Farelli/ZonamaDev/releases{/id}","deployments_url":"https://api.github.com/repos/Farelli/ZonamaDev/deployments","created_at":"2016-09-22T14:53:20Z","updated_at":"2016-09-22T18:00:15Z","pushed_at":"2016-10-04T20:03:06Z","git_url":"git://github.com/Farelli/ZonamaDev.git","ssh_url":"git@github.com:Farelli/ZonamaDev.git","clone_url":"https://github.com/Farelli/ZonamaDev.git","svn_url":"https://github.com/Farelli/ZonamaDev","homepage":"http://www.swgemu.com/forums/showthread.php?t=175307","size":17787,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"lordkator:master","ref":"master","sha":"6b9848a2807c75a3743d10078c308032e7956c6a","user":{"login":"lordkator","id":10178221,"avatar_url":"https://avatars.githubusercontent.com/u/10178221?v=3","gravatar_id":"","url":"https://api.github.com/users/lordkator","html_url":"https://github.com/lordkator","followers_url":"https://api.github.com/users/lordkator/followers","following_url":"https://api.github.com/users/lordkator/following{/other_user}","gists_url":"https://api.github.com/users/lordkator/gists{/gist_id}","starred_url":"https://api.github.com/users/lordkator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lordkator/subscriptions","organizations_url":"https://api.github.com/users/lordkator/orgs","repos_url":"https://api.github.com/users/lordkator/repos","events_url":"https://api.github.com/users/lordkator/events{/privacy}","received_events_url":"https://api.github.com/users/lordkator/received_events","type":"User","site_admin":false},"repo":{"id":48459711,"name":"ZonamaDev","full_name":"lordkator/ZonamaDev","owner":{"login":"lordkator","id":10178221,"avatar_url":"https://avatars.githubusercontent.com/u/10178221?v=3","gravatar_id":"","url":"https://api.github.com/users/lordkator","html_url":"https://github.com/lordkator","followers_url":"https://api.github.com/users/lordkator/followers","following_url":"https://api.github.com/users/lordkator/following{/other_user}","gists_url":"https://api.github.com/users/lordkator/gists{/gist_id}","starred_url":"https://api.github.com/users/lordkator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lordkator/subscriptions","organizations_url":"https://api.github.com/users/lordkator/orgs","repos_url":"https://api.github.com/users/lordkator/repos","events_url":"https://api.github.com/users/lordkator/events{/privacy}","received_events_url":"https://api.github.com/users/lordkator/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lordkator/ZonamaDev","description":"Development Environment for SWGEMU","fork":false,"url":"https://api.github.com/repos/lordkator/ZonamaDev","forks_url":"https://api.github.com/repos/lordkator/ZonamaDev/forks","keys_url":"https://api.github.com/repos/lordkator/ZonamaDev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lordkator/ZonamaDev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lordkator/ZonamaDev/teams","hooks_url":"https://api.github.com/repos/lordkator/ZonamaDev/hooks","issue_events_url":"https://api.github.com/repos/lordkator/ZonamaDev/issues/events{/number}","events_url":"https://api.github.com/repos/lordkator/ZonamaDev/events","assignees_url":"https://api.github.com/repos/lordkator/ZonamaDev/assignees{/user}","branches_url":"https://api.github.com/repos/lordkator/ZonamaDev/branches{/branch}","tags_url":"https://api.github.com/repos/lordkator/ZonamaDev/tags","blobs_url":"https://api.github.com/repos/lordkator/ZonamaDev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lordkator/ZonamaDev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lordkator/ZonamaDev/git/refs{/sha}","trees_url":"https://api.github.com/repos/lordkator/ZonamaDev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lordkator/ZonamaDev/statuses/{sha}","languages_url":"https://api.github.com/repos/lordkator/ZonamaDev/languages","stargazers_url":"https://api.github.com/repos/lordkator/ZonamaDev/stargazers","contributors_url":"https://api.github.com/repos/lordkator/ZonamaDev/contributors","subscribers_url":"https://api.github.com/repos/lordkator/ZonamaDev/subscribers","subscription_url":"https://api.github.com/repos/lordkator/ZonamaDev/subscription","commits_url":"https://api.github.com/repos/lordkator/ZonamaDev/commits{/sha}","git_commits_url":"https://api.github.com/repos/lordkator/ZonamaDev/git/commits{/sha}","comments_url":"https://api.github.com/repos/lordkator/ZonamaDev/comments{/number}","issue_comment_url":"https://api.github.com/repos/lordkator/ZonamaDev/issues/comments{/number}","contents_url":"https://api.github.com/repos/lordkator/ZonamaDev/contents/{+path}","compare_url":"https://api.github.com/repos/lordkator/ZonamaDev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lordkator/ZonamaDev/merges","archive_url":"https://api.github.com/repos/lordkator/ZonamaDev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lordkator/ZonamaDev/downloads","issues_url":"https://api.github.com/repos/lordkator/ZonamaDev/issues{/number}","pulls_url":"https://api.github.com/repos/lordkator/ZonamaDev/pulls{/number}","milestones_url":"https://api.github.com/repos/lordkator/ZonamaDev/milestones{/number}","notifications_url":"https://api.github.com/repos/lordkator/ZonamaDev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lordkator/ZonamaDev/labels{/name}","releases_url":"https://api.github.com/repos/lordkator/ZonamaDev/releases{/id}","deployments_url":"https://api.github.com/repos/lordkator/ZonamaDev/deployments","created_at":"2015-12-23T00:00:24Z","updated_at":"2016-09-27T18:08:14Z","pushed_at":"2016-10-04T20:03:07Z","git_url":"git://github.com/lordkator/ZonamaDev.git","ssh_url":"git@github.com:lordkator/ZonamaDev.git","clone_url":"https://github.com/lordkator/ZonamaDev.git","svn_url":"https://github.com/lordkator/ZonamaDev","homepage":"http://www.swgemu.com/forums/showthread.php?t=175307","size":18004,"stargazers_count":17,"watchers_count":17,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":37,"forks":15,"open_issues":37,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lordkator/ZonamaDev/pulls/178"},"html":{"href":"https://github.com/lordkator/ZonamaDev/pull/178"},"issue":{"href":"https://api.github.com/repos/lordkator/ZonamaDev/issues/178"},"comments":{"href":"https://api.github.com/repos/lordkator/ZonamaDev/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/lordkator/ZonamaDev/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/lordkator/ZonamaDev/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lordkator/ZonamaDev/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/lordkator/ZonamaDev/statuses/288aa5bd016cf170b48ae6ba461ab084ba341478"}}}}
{"actor":{"display_login":"karlbunch"}}