sh 一个bash脚本,用于在Ubuntu上设置OneDrive与GNOME的集成。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 一个bash脚本,用于在Ubuntu上设置OneDrive与GNOME的集成。相关的知识,希望对你有一定的参考价值。

#!/bin/sh

# onedrive-ubu.sh
# A BASH script to set up OneDrive integration with GNOME on Ubuntu
# Copyright (C) 2018 Garrett Mills (garrett@glmdev.tech)
# This software is licensed under the MIT License.
# This sofware is provided without warranty or even any implied intent of purpose.
#
# OnedriveD: https://github.com/xybu/onedrived-dev

clear
echo "Checking for ngrok..."
if ! which ngrok ; then
  echo "onedrived requires ngrok. Please download and install it from: https://ngrok.com/download"
  exit 1
done

clear
echo "Setting up OneDrive for Ubuntu GNOME..."
sleep 1
echo "Authorize sudo..."
sudo echo "Success!"
echo "Verifying dependencies..."
sleep 1
sudo apt update > /dev/null
sudo apt install -y git build-essential python3-dev libssl-dev inotify-tools python3-pip python3-dbus > /dev/null

echo "Removing any old versions of onedrived..."
sudo pip3 uninstall -y onedrive_d onedrived > /dev/null
sudo rm -rf ~/.onedrive ~/.onedrived ~/.odd

echo "Downloading onedrived..."
git clone --quiet https://github.com/xybu/onedrived-dev.git ~/.odd > /dev/null
cd ~/.odd

echo "Installing onedrived..."
sudo python3 ./setup.py install > /dev/null

echo "Configuring onedrived..."
echo "Configuring account..."
onedrived-pref account add

echo "Configuring drive..."
onedrived-pref drive set

echo "Starting OneDrive daemon..."
onedrived start

echo "Modifying default user directories..."
rm -rf ~/.config/user-dirs.dirs
echo '
# This file was written by an automatic generator while
# setting up the OneDrive integration with onedrived.

XDG_DESKTOP_DIR="$HOME/OneDrive/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/OneDrive/Public"
XDG_DOCUMENTS_DIR="$HOME/OneDrive/Documents"
XDG_MUSIC_DIR="$HOME/OneDrive/Music"
XDG_PICTURES_DIR="$HOME/OneDrive/Pictures"
XDG_VIDEOS_DIR="$HOME/OneDrive/Videos"
' > ~/.config/user-dirs.dirs

rm -rf ~/.config/user-dirs.conf
echo "enabled=false" > ~/.config/user-dirs.conf

echo "Creating auto-start entry..."
echo "
[Desktop Entry]
Name=OneDrive Daemon Autostart
Exec=onedrived start
Type=Application
X-GNOME-Autostart-enabled=true
" > ~/.config/onedrive_daemon.desktop

echo "Success!"

以上是关于sh 一个bash脚本,用于在Ubuntu上设置OneDrive与GNOME的集成。的主要内容,如果未能解决你的问题,请参考以下文章

sh 用于Ubuntu 14.0.4的LEMP堆栈安装Bash脚本

sh 用于Ubuntu 14.0.4的LEMP堆栈安装Bash脚本

sh 用于在Ubuntu 16系统上设置Laravel Production环境的shell脚本。

sh 用于快速设置Golang环境的Bash脚本

sh 用于快速(呃)Laravel应用程序设置的Bash脚本

sh 一个简单的bash脚本,用于在Unix / Linux上使用ping观察数据包丢失