-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.py
More file actions
23 lines (19 loc) · 718 Bytes
/
Copy pathupdate.py
File metadata and controls
23 lines (19 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#python script to update and upgrade warpi
#os.system commands commented out for testing purposes; remove comment out once successfully tested
#comment out print statements while enabling os.system commands
import os, time, datetime
now = datetime.datetime.now()
update = raw_input ('Update WarPi before backup? (Y/N)\n\r')
if update == 'Y':
print 'Updating WarPi...'
time.sleep(1)
os.system ('cd /home/')
time.sleep(1)
os.system ('sudo apt-get update && sudo apt-get upgrade')
#print 'update/upgrade command invocation' #enable to debug code
time.sleep(3)
print 'WarPi updated on ' + now.strftime('%b %d, %Y %H:%M')
time.sleep(1)
else:
print 'Consider updating WarPi at a later date...'
time.sleep(1)