Created
January 12, 2014 14:47
-
-
Save yuitest/8385440 to your computer and use it in GitHub Desktop.
Ubuntu Server 12.04 LTS に、
Skype をサービスとしてインストールするための fabfile だよ!!! 参考にしたよ → http://orangain.hatenablog.com/entry/20130223/1361629662
というか、中身は殆どそのままだよ!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from __future__ import unicode_literals, print_function | |
from fabric.api import ( | |
env, | |
run, | |
sudo, | |
cd, | |
) | |
from cuisine import package_ensure, select_package | |
SKYPE_INIT_SCRIPT = ( | |
'https://gist.github.com/' | |
'orangain/5018807/raw/' | |
'ebd824e5e7fbf4037228d0203be5ae7aac111415/skype' | |
) | |
env.use_ssh_config = True | |
env.shell = '/bin/bash -l -i -c' | |
select_package('apt') | |
def install_skype_service(): | |
add_deb_line( | |
'http://archive.canonical.com/', | |
'precise', 'partner') | |
package_ensure([ | |
'xvfb', | |
'x11vnc', | |
'fonts-takao', | |
'skype', | |
]) | |
with cd('/etc/init.d'): | |
sudo('wget {}'.format(SKYPE_INIT_SCRIPT)) | |
sudo('chmod +x skype') | |
sudo('useradd -m skype') | |
sudo('service skype start') | |
sudo('update-rc.d skype defaults 80 10') | |
def add_deb_line(url, distribution, components): | |
package_ensure('python-software-properties') | |
deb_line = 'deb {url} {distribution} {components}'.format( | |
url=url, | |
distribution=distribution, | |
components=components, | |
) | |
sudo( | |
"grep '{0}' /etc/apt/sources.list || add-apt-repository -y '{0}'" | |
.format(deb_line) | |
) | |
aptitude_update() | |
def aptitude_update(): | |
sudo('aptitude update -y -q') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment