Преглед изворни кода

Deprecate backup of github projects

Since gogs can do that
Bob Mottram пре 9 година
родитељ
комит
6fd4d2b084
1 измењених фајлова са 0 додато и 53 уклоњено
  1. 0
    53
      src/freedombone

+ 0
- 53
src/freedombone Прегледај датотеку

321
 # File which keeps track of what has already been installed
321
 # File which keeps track of what has already been installed
322
 COMPLETION_FILE=$HOME/freedombone-completed.txt
322
 COMPLETION_FILE=$HOME/freedombone-completed.txt
323
 
323
 
324
-# Your github username
325
-GITHUB_USERNAME=
326
-
327
-# Directory where github projects will be backed up
328
-GITHUB_BACKUP_DIRECTORY=/var/backups/github
329
-
330
 # Used to indicate whether the backup contains MariaDB databases or not
324
 # Used to indicate whether the backup contains MariaDB databases or not
331
 BACKUP_INCLUDES_DATABASES="no"
325
 BACKUP_INCLUDES_DATABASES="no"
332
 
326
 
1076
       if grep -q "ROUTER_IP_ADDRESS" $CONFIGURATION_FILE; then
1070
       if grep -q "ROUTER_IP_ADDRESS" $CONFIGURATION_FILE; then
1077
           ROUTER_IP_ADDRESS=$(grep "ROUTER_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1071
           ROUTER_IP_ADDRESS=$(grep "ROUTER_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1078
       fi
1072
       fi
1079
-      if grep -q "GITHUB_USERNAME" $CONFIGURATION_FILE; then
1080
-          GITHUB_USERNAME=$(grep "GITHUB_USERNAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1081
-      fi
1082
-      if grep -q "GITHUB_BACKUP_DIRECTORY" $CONFIGURATION_FILE; then
1083
-          GITHUB_BACKUP_DIRECTORY=$(grep "GITHUB_BACKUP_DIRECTORY" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1084
-      fi
1085
       if grep -q "CPU_CORES" $CONFIGURATION_FILE; then
1073
       if grep -q "CPU_CORES" $CONFIGURATION_FILE; then
1086
           CPU_CORES=$(grep "CPU_CORES" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1074
           CPU_CORES=$(grep "CPU_CORES" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1087
       fi
1075
       fi
11339
   echo 'create_git_project' >> $COMPLETION_FILE
11327
   echo 'create_git_project' >> $COMPLETION_FILE
11340
 }
11328
 }
11341
 
11329
 
11342
-# Create daily backups of any projects on Github
11343
-# Then if Github goes away, turns evil, is censored or has
11344
-# outages then you still have access to your projects
11345
-function backup_github_projects {
11346
-  if grep -Fxq "backup_github_projects" $COMPLETION_FILE; then
11347
-      return
11348
-  fi
11349
-  if [ ! $GITHUB_USERNAME ]; then
11350
-      return 731
11351
-  fi
11352
-  if [ ! $GITHUB_BACKUP_DIRECTORY ]; then
11353
-      return 732
11354
-  fi
11355
-  apt-get -y install git
11356
-
11357
-  # create a github backups directory if needed
11358
-  if [ ! -d $GITHUB_BACKUP_DIRECTORY ]; then
11359
-      mkdir -p $GITHUB_BACKUP_DIRECTORY
11360
-  fi
11361
-
11362
-  # get the backup utility
11363
-  cd $INSTALL_DIR
11364
-  git clone https://github.com/josegonzalez/python-github-backup
11365
-
11366
-  # install it
11367
-  cd $INSTALL_DIR/python-github-backup
11368
-  python setup.py install
11369
-
11370
-  # add a daily cron entry
11371
-  echo '#!/bin/bash' > /etc/cron.daily/github
11372
-  echo "github-backup $GITHUB_USERNAME -o $GITHUB_BACKUP_DIRECTORY --repositories" >> /etc/cron.daily/github
11373
-  echo 'exit 0' >> /etc/cron.daily/github
11374
-  chmod +x /etc/cron.daily/github
11375
-
11376
-  # do an initial backup
11377
-  /etc/cron.daily/github
11378
-
11379
-  echo 'backup_github_projects' >> $COMPLETION_FILE
11380
-}
11381
-
11382
 function check_date {
11330
 function check_date {
11383
   curr_date=$(date)
11331
   curr_date=$(date)
11384
   if [[ $curr_date == *"1970"* ]]; then
11332
   if [[ $curr_date == *"1970"* ]]; then
11876
 time_synchronisation
11824
 time_synchronisation
11877
 configure_internet_protocol
11825
 configure_internet_protocol
11878
 create_git_project
11826
 create_git_project
11879
-backup_github_projects
11880
 configure_ssh
11827
 configure_ssh
11881
 remove_instructions_from_motd
11828
 remove_instructions_from_motd
11882
 check_hwrng
11829
 check_hwrng